<!doctype html>
<html>
<head>
<meta charset='UTF-8'><meta name='viewport' content='width=device-width initial-scale=1'>
<title>tums-player使用说明</title><link href='https://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,700,400&subset=latin,latin-ext' rel='stylesheet' type='text/css' /><style type='text/css'>html {overflow-x: initial !important;}:root { --node-fill: #ECECFF; --node-border: #CCCCFF; --note-fill: #fff5ad; --note-border: #aaaa33; --cluster-fill: #ffffde  !important; --cluster-border: #aaaa33  !important; }
.mermaid .label { color: var(--text-color); }
.node rect, .node circle, .node ellipse, .node polygon { fill: var(--node-fill); stroke: var(--node-border); stroke-width: 1px; }
.edgePath .path { stroke: var(--text-color); }
.edgeLabel { background-color: var(--bg-color); }
.cluster rect { fill: rgb(255, 255, 222) !important; rx: 4 !important; stroke: rgb(170, 170, 51) !important; stroke-width: 1px !important; }
.cluster text { fill: var(--text-color); }
.actor { stroke: var(--node-border); fill: var(--node-fill); }
text.actor { fill: var(--text-color); stroke: none; }
.actor-line { stroke: grey; }
.messageLine0 { stroke-width: 1.5; stroke: var(--text-color); }
.messageLine1 { stroke-width: 1.5; stroke: var(--text-color); }
#arrowhead { fill: var(--text-color); }
#crosshead path { fill: var(--text-color)  !important; stroke: var(--text-color)  !important; }
.messageText { fill: var(--text-color); stroke: none; }
.labelBox { stroke: var(--node-border); fill: var(--node-fill); }
.labelText { fill: var(--text-color); stroke: none; }
.loopText { fill: var(--text-color); stroke: none; }
.loopLine { stroke-width: 2; stroke: var(--node-border); }
.note { stroke: var(--note-border); fill: var(--note-fill); }
.noteText { fill: var(--text-color); stroke: none; font-size: 14px; }
.section { stroke: none; opacity: 0.2; }
.section0 { fill: rgba(102, 102, 255, 0.49); }
.section2 { fill: rgb(255, 244, 0); }
.section1, .section3 { fill: white; opacity: 0.2; }
.sectionTitle0 { fill: var(--text-color); }
.sectionTitle1 { fill: var(--text-color); }
.sectionTitle2 { fill: var(--text-color); }
.sectionTitle3 { fill: var(--text-color); }
.sectionTitle { text-anchor: start; font-size: 11px; }
.grid .tick { stroke: lightgrey; opacity: 0.3; shape-rendering: crispEdges; }
.grid path { stroke-width: 0; }
.today { fill: none; stroke: red; stroke-width: 2px; }
.task { stroke-width: 2; }
.taskText { text-anchor: middle; font-size: 11px; }
.taskTextOutsideRight { fill: black; text-anchor: start; font-size: 11px; }
.taskTextOutsideLeft { fill: black; text-anchor: end; font-size: 11px; }
.taskText0, .taskText1, .taskText2, .taskText3 { fill: white; }
.task0, .task1, .task2, .task3 { fill: rgb(138, 144, 221); stroke: rgb(83, 79, 188); }
.taskTextOutside0, .taskTextOutside2 { fill: var(--text-color); }
.taskTextOutside1, .taskTextOutside3 { fill: var(--text-color); }
.active0, .active1, .active2, .active3 { fill: rgb(191, 199, 255); stroke: rgb(83, 79, 188); }
.activeText0, .activeText1, .activeText2, .activeText3 { fill: black !important; }
.done0, .done1, .done2, .done3 { stroke: grey; fill: lightgrey; stroke-width: 2; }
.doneText0, .doneText1, .doneText2, .doneText3 { fill: black !important; }
.crit0, .crit1, .crit2, .crit3 { stroke: rgb(255, 136, 136); fill: red; stroke-width: 2; }
.activeCrit0, .activeCrit1, .activeCrit2, .activeCrit3 { stroke: rgb(255, 136, 136); fill: rgb(191, 199, 255); stroke-width: 2; }
.doneCrit0, .doneCrit1, .doneCrit2, .doneCrit3 { stroke: rgb(255, 136, 136); fill: lightgrey; stroke-width: 2; cursor: pointer; shape-rendering: crispEdges; }
.doneCritText0, .doneCritText1, .doneCritText2, .doneCritText3 { fill: black !important; }
.activeCritText0, .activeCritText1, .activeCritText2, .activeCritText3 { fill: black !important; }
.titleText { text-anchor: middle; font-size: 18px; fill: black; }
.node text { font-size: 14px; }
div.mermaidTooltip { position: absolute; text-align: center; max-width: 200px; padding: 2px; font-size: 12px; background: rgb(255, 255, 222); border: 1px solid rgb(170, 170, 51); border-radius: 2px; pointer-events: none; z-index: 100; }
#write .md-diagram-panel .md-diagram-panel-preview div { width: initial; }


:root { --bg-color:#ffffff; --text-color:#333333; --select-text-bg-color:#B5D6FC; --select-text-font-color:auto; }
html { font-size: 14px; background-color: var(--bg-color); color: var(--text-color); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body { margin: 0px; padding: 0px; height: auto; bottom: 0px; top: 0px; left: 0px; right: 0px; font-size: 1rem; line-height: 1.42857; overflow-x: hidden; background: inherit; }
a.url { word-break: break-all; }
a:active, a:hover { outline: 0px; }
.in-text-selection, ::selection { text-shadow: none; background: var(--select-text-bg-color); color: var(--select-text-font-color); }
#write { margin: 0px auto; height: auto; width: inherit; word-break: normal; word-wrap: break-word; position: relative; padding-bottom: 70px; white-space: pre-wrap; overflow-x: visible; }
.first-line-indent #write p .md-line { text-indent: 0px; }
.first-line-indent #write li, .first-line-indent #write p, .first-line-indent #write p .md-line:first-child { text-indent: 2em; }
.for-image #write { padding-left: 8px; padding-right: 8px; }
body.typora-export { padding-left: 30px; padding-right: 30px; }
@media screen and (max-width: 500px) {
  body.typora-export { padding-left: 0px; padding-right: 0px; }
  .CodeMirror-sizer { margin-left: 0px !important; }
  .CodeMirror-gutters { display: none !important; }
}
#write > blockquote:first-child, #write > div:first-child, #write > figure:first-child, #write > ol:first-child, #write > p:first-child, #write > pre:first-child, #write > ul:first-child { margin-top: 30px; }
#write li > figure:first-child { margin-top: -20px; }
#write ol, #write ul { position: relative; }
img { max-width: 100%; vertical-align: middle; }
button, input, select, textarea { color: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; }
input[type="checkbox"], input[type="radio"] { line-height: normal; padding: 0px; }
*, ::after, ::before { box-sizing: border-box; }
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p, #write pre { width: inherit; }
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p { position: relative; }
h1, h2, h3, h4, h5, h6 { break-after: avoid-page; break-inside: avoid; orphans: 2; }
p { orphans: 4; }
h1 { font-size: 2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.4rem; }
h5 { font-size: 1.2rem; }
h6 { font-size: 1rem; }
h1, h2, h3, h4, h5, h6 { margin-top: 1rem; margin-bottom: 1rem; }
p { -webkit-margin-before: 1rem; -webkit-margin-after: 1rem; -webkit-margin-start: 0px; -webkit-margin-end: 0px; }
.mathjax-block { margin-top: 0px; margin-bottom: 0px; -webkit-margin-before: 0px; -webkit-margin-after: 0px; }
.hidden { display: none; }
.md-blockmeta { color: rgb(204, 204, 204); font-weight: 700; font-style: italic; }
a { cursor: pointer; }
sup.md-footnote { padding: 2px 4px; background-color: rgba(238, 238, 238, 0.7); color: rgb(85, 85, 85); border-radius: 4px; cursor: pointer; }
sup.md-footnote a, sup.md-footnote a:hover { color: inherit; text-transform: inherit; text-decoration: inherit; }
#write input[type="checkbox"] { cursor: pointer; width: inherit; height: inherit; }
figure { overflow-x: auto; margin: 1.2em 0px; max-width: calc(100% + 16px); padding: 0px; }
figure > table { margin: 0px !important; }
tr { break-inside: avoid; break-after: auto; }
thead { display: table-header-group; }
table { border-collapse: collapse; border-spacing: 0px; width: 100%; overflow: auto; break-inside: auto; text-align: left; }
table.md-table td { min-width: 80px; }
.CodeMirror-gutters { border-right: 0px; background-color: inherit; }
.CodeMirror { text-align: left; }
.CodeMirror-placeholder { opacity: 0.3; }
.CodeMirror pre { padding: 0px 4px; }
.CodeMirror-lines { padding: 0px; }
div.hr:focus { cursor: none; }
pre { white-space: pre-wrap; }
pre.contain-cm { white-space: normal; }
.CodeMirror-gutters { margin-right: 4px; }
.md-fences { font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; overflow: visible; white-space: pre; background: inherit; position: relative !important; }
.md-diagram-panel { width: 100%; margin-top: 10px; text-align: center; padding-top: 0px; padding-bottom: 8px; overflow-x: auto; }
.md-fences.mock-cm { white-space: pre-wrap; }
.show-fences-line-number .md-fences { padding-left: 0px; }
.show-fences-line-number .md-fences.mock-cm { padding-left: 40px; }
.CodeMirror-line { break-inside: avoid; }
.footnotes { opacity: 0.8; font-size: 0.9rem; margin-top: 1em; margin-bottom: 1em; }
.footnotes + .footnotes { margin-top: 0px; }
.md-reset { margin: 0px; padding: 0px; border: 0px; outline: 0px; vertical-align: top; background: 0px 0px; text-decoration: none; text-shadow: none; float: none; position: static; width: auto; height: auto; white-space: nowrap; cursor: inherit; -webkit-tap-highlight-color: transparent; line-height: normal; font-weight: 400; text-align: left; box-sizing: content-box; direction: ltr; }
li div { padding-top: 0px; }
blockquote { margin: 1rem 0px; }
li .mathjax-block, li p { margin: 0.5rem 0px; }
li { margin: 0px; position: relative; }
blockquote > :last-child { margin-bottom: 0px; }
blockquote > :first-child, li > :first-child { margin-top: 0px; }
.footnotes-area { color: rgb(136, 136, 136); margin-top: 0.714rem; padding-bottom: 0.143rem; white-space: normal; }
.footnote-line { white-space: pre-wrap; }
@media print {
  body, html { border: 1px solid transparent; height: 99%; break-after: avoid; break-before: avoid; }
  #write { margin-top: 0px; border-color: transparent !important; }
  .typora-export * { -webkit-print-color-adjust: exact; }
  html.blink-to-pdf { font-size: 13px; }
  .typora-export #write { padding-left: 1cm; padding-right: 1cm; padding-bottom: 0px; break-after: avoid; }
  .typora-export #write::after { height: 0px; }
  @page { margin: 20mm 0px; }
}
.footnote-line { margin-top: 0.714em; font-size: 0.7em; }
a img, img a { cursor: pointer; }
pre.md-meta-block { font-size: 0.8rem; min-height: 0.8rem; white-space: pre-wrap; background: rgb(204, 204, 204); display: block; overflow-x: hidden; }
p > img:only-child { display: block; margin: auto; }
.md-line > .md-image:only-child, p > .md-image:only-child { display: inline-block; width: 100%; text-align: center; }
#write .MathJax_Display { margin: 0.8em 0px 0px; }
.mathjax-block { white-space: pre; overflow: hidden; width: 100%; }
p + .mathjax-block { margin-top: -1.143rem; }
.mathjax-block:not(:empty)::after { display: none; }
[contenteditable="true"]:active, [contenteditable="true"]:focus { outline: 0px; box-shadow: none; }
.md-task-list-item { position: relative; list-style-type: none; }
.task-list-item.md-task-list-item { padding-left: 0px; }
.md-task-list-item > input { position: absolute; top: 0px; left: 0px; margin-left: -1.2em; margin-top: calc(1em - 10px); }
.math { font-size: 1rem; }
.md-toc { min-height: 3.58rem; position: relative; font-size: 0.9rem; border-radius: 10px; }
.md-toc-content { position: relative; margin-left: 0px; }
.md-toc-content::after, .md-toc::after { display: none; }
.md-toc-item { display: block; color: rgb(65, 131, 196); }
.md-toc-item a { text-decoration: none; }
.md-toc-inner:hover { }
.md-toc-inner { display: inline-block; cursor: pointer; }
.md-toc-h1 .md-toc-inner { margin-left: 0px; font-weight: 700; }
.md-toc-h2 .md-toc-inner { margin-left: 2em; }
.md-toc-h3 .md-toc-inner { margin-left: 4em; }
.md-toc-h4 .md-toc-inner { margin-left: 6em; }
.md-toc-h5 .md-toc-inner { margin-left: 8em; }
.md-toc-h6 .md-toc-inner { margin-left: 10em; }
@media screen and (max-width: 48em) {
  .md-toc-h3 .md-toc-inner { margin-left: 3.5em; }
  .md-toc-h4 .md-toc-inner { margin-left: 5em; }
  .md-toc-h5 .md-toc-inner { margin-left: 6.5em; }
  .md-toc-h6 .md-toc-inner { margin-left: 8em; }
}
a.md-toc-inner { font-size: inherit; font-style: inherit; font-weight: inherit; line-height: inherit; }
.footnote-line a:not(.reversefootnote) { color: inherit; }
.md-attr { display: none; }
.md-fn-count::after { content: "."; }
code, pre, tt { font-family: var(--monospace); }
.md-comment { color: rgb(162, 127, 3); opacity: 0.8; font-family: var(--monospace); }
code { text-align: left; }
a.md-print-anchor { border-width: initial !important; border-style: none !important; border-color: initial !important; display: inline-block !important; position: absolute !important; width: 1px !important; right: 0px !important; outline: 0px !important; background: 0px 0px !important; text-decoration: initial !important; text-shadow: initial !important; }
.md-inline-math .MathJax_SVG .noError { display: none !important; }
.mathjax-block .MathJax_SVG_Display { text-align: center; margin: 1em 0px; position: relative; text-indent: 0px; max-width: none; max-height: none; min-height: 0px; min-width: 100%; width: auto; display: block !important; }
.MathJax_SVG_Display, .md-inline-math .MathJax_SVG_Display { width: auto; margin: inherit; display: inline-block !important; }
.MathJax_SVG .MJX-monospace { font-family: monospace; }
.MathJax_SVG .MJX-sans-serif { font-family: sans-serif; }
.MathJax_SVG { display: inline; font-style: normal; font-weight: 400; line-height: normal; zoom: 90%; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; }
.MathJax_SVG * { transition: none; }
.os-windows.monocolor-emoji .md-emoji { font-family: "Segoe UI Symbol", sans-serif; }
.md-diagram-panel > svg { max-width: 100%; }
[lang="flow"] svg, [lang="mermaid"] svg { max-width: 100%; }
[lang="mermaid"] .node text { font-size: 1rem; }
table tr th { border-bottom: 0px; }


.CodeMirror { height: auto; }
.CodeMirror.cm-s-inner { background: inherit; }
.CodeMirror-scroll { overflow-y: hidden; overflow-x: auto; z-index: 3; }
.CodeMirror-lines { padding: 4px 0px; }
.CodeMirror-gutter-filler, .CodeMirror-scrollbar-filler { background-color: rgb(255, 255, 255); }
.CodeMirror-gutters { border-right: 1px solid rgb(221, 221, 221); background: inherit; white-space: nowrap; }
.CodeMirror-linenumber { padding: 0px 3px 0px 5px; text-align: right; color: rgb(153, 153, 153); }
.cm-s-inner .cm-keyword { color: rgb(119, 0, 136); }
.cm-s-inner .cm-atom, .cm-s-inner.cm-atom { color: rgb(34, 17, 153); }
.cm-s-inner .cm-number { color: rgb(17, 102, 68); }
.cm-s-inner .cm-def { color: rgb(0, 0, 255); }
.cm-s-inner .cm-variable { color: rgb(0, 0, 0); }
.cm-s-inner .cm-variable-2 { color: rgb(0, 85, 170); }
.cm-s-inner .cm-variable-3 { color: rgb(0, 136, 85); }
.cm-s-inner .cm-string { color: rgb(170, 17, 17); }
.cm-s-inner .cm-property { color: rgb(0, 0, 0); }
.cm-s-inner .cm-operator { color: rgb(152, 26, 26); }
.cm-s-inner .cm-comment, .cm-s-inner.cm-comment { color: rgb(170, 85, 0); }
.cm-s-inner .cm-string-2 { color: rgb(255, 85, 0); }
.cm-s-inner .cm-meta { color: rgb(85, 85, 85); }
.cm-s-inner .cm-qualifier { color: rgb(85, 85, 85); }
.cm-s-inner .cm-builtin { color: rgb(51, 0, 170); }
.cm-s-inner .cm-bracket { color: rgb(153, 153, 119); }
.cm-s-inner .cm-tag { color: rgb(17, 119, 0); }
.cm-s-inner .cm-attribute { color: rgb(0, 0, 204); }
.cm-s-inner .cm-header, .cm-s-inner.cm-header { color: rgb(0, 0, 255); }
.cm-s-inner .cm-quote, .cm-s-inner.cm-quote { color: rgb(0, 153, 0); }
.cm-s-inner .cm-hr, .cm-s-inner.cm-hr { color: rgb(153, 153, 153); }
.cm-s-inner .cm-link, .cm-s-inner.cm-link { color: rgb(0, 0, 204); }
.cm-negative { color: rgb(221, 68, 68); }
.cm-positive { color: rgb(34, 153, 34); }
.cm-header, .cm-strong { font-weight: 700; }
.cm-del { text-decoration: line-through; }
.cm-em { font-style: italic; }
.cm-link { text-decoration: underline; }
.cm-error { color: red; }
.cm-invalidchar { color: red; }
.cm-constant { color: rgb(38, 139, 210); }
.cm-defined { color: rgb(181, 137, 0); }
div.CodeMirror span.CodeMirror-matchingbracket { color: rgb(0, 255, 0); }
div.CodeMirror span.CodeMirror-nonmatchingbracket { color: rgb(255, 34, 34); }
.cm-s-inner .CodeMirror-activeline-background { background: inherit; }
.CodeMirror { position: relative; overflow: hidden; }
.CodeMirror-scroll { margin-bottom: -30px; padding-bottom: 30px; height: 100%; outline: 0px; position: relative; box-sizing: content-box; background: inherit; }
.CodeMirror-sizer { position: relative; }
.CodeMirror-gutter-filler, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-vscrollbar { position: absolute; z-index: 6; display: none; }
.CodeMirror-vscrollbar { right: 0px; top: 0px; overflow: hidden; }
.CodeMirror-hscrollbar { bottom: 0px; left: 0px; overflow-y: hidden; overflow-x: scroll; }
.CodeMirror-scrollbar-filler { right: 0px; bottom: 0px; }
.CodeMirror-gutter-filler { left: 0px; bottom: 0px; }
.CodeMirror-gutters { position: absolute; left: 0px; top: 0px; padding-bottom: 30px; z-index: 3; }
.CodeMirror-gutter { white-space: normal; height: 100%; box-sizing: content-box; padding-bottom: 30px; margin-bottom: -32px; display: inline-block; }
.CodeMirror-gutter-wrapper { position: absolute; z-index: 4; background: 0px 0px !important; border: none !important; }
.CodeMirror-gutter-background { position: absolute; top: 0px; bottom: 0px; z-index: 4; }
.CodeMirror-gutter-elt { position: absolute; cursor: default; z-index: 4; }
.CodeMirror-lines { cursor: text; }
.CodeMirror pre { border-radius: 0px; border-width: 0px; background: 0px 0px; font-family: inherit; font-size: inherit; margin: 0px; white-space: pre; word-wrap: normal; color: inherit; z-index: 2; position: relative; overflow: visible; }
.CodeMirror-wrap pre { word-wrap: break-word; white-space: pre-wrap; word-break: normal; }
.CodeMirror-code pre { border-right: 30px solid transparent; width: fit-content; }
.CodeMirror-wrap .CodeMirror-code pre { border-right: none; width: auto; }
.CodeMirror-linebackground { position: absolute; left: 0px; right: 0px; top: 0px; bottom: 0px; z-index: 0; }
.CodeMirror-linewidget { position: relative; z-index: 2; overflow: auto; }
.CodeMirror-wrap .CodeMirror-scroll { overflow-x: hidden; }
.CodeMirror-measure { position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden; }
.CodeMirror-measure pre { position: static; }
.CodeMirror div.CodeMirror-cursor { position: absolute; visibility: hidden; border-right: none; width: 0px; }
.CodeMirror div.CodeMirror-cursor { visibility: hidden; }
.CodeMirror-focused div.CodeMirror-cursor { visibility: inherit; }
.cm-searching { background: rgba(255, 255, 0, 0.4); }
@media print {
  .CodeMirror div.CodeMirror-cursor { visibility: hidden; }
}
.CodeMirror-lint-markers { width: 16px; }
.CodeMirror-lint-tooltip { background-color: infobackground; border: 1px solid rgb(0, 0, 0); border-radius: 4px; color: infotext; font-family: var(--monospace); overflow: hidden; padding: 2px 5px; position: fixed; white-space: pre-wrap; z-index: 10000; max-width: 600px; opacity: 0; transition: opacity 0.4s; font-size: 0.8em; }
.CodeMirror-lint-mark-error, .CodeMirror-lint-mark-warning { background-position: left bottom; background-repeat: repeat-x; }
.CodeMirror-lint-mark-error { background-image: url(""); }
.CodeMirror-lint-marker-error, .CodeMirror-lint-marker-warning { background-position: center center; background-repeat: no-repeat; cursor: pointer; display: inline-block; height: 16px; width: 16px; vertical-align: middle; position: relative; }
.CodeMirror-lint-message-error, .CodeMirror-lint-message-warning { padding-left: 18px; background-position: left top; background-repeat: no-repeat; }
.CodeMirror-lint-marker-error, .CodeMirror-lint-message-error { background-image: url(""); }
.CodeMirror-lint-marker-warning, .CodeMirror-lint-message-warning { background-image: url(""); }
.CodeMirror-lint-marker-multiple { background-image: url(""); background-repeat: no-repeat; background-position: right bottom; width: 100%; height: 100%; }


:root { --side-bar-bg-color: #fafafa; --control-text-color: #777; }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: normal; src: local("Open Sans Regular"), url("./github/400.woff") format("woff"); }
@font-face { font-family: "Open Sans"; font-style: italic; font-weight: normal; src: local("Open Sans Italic"), url("./github/400i.woff") format("woff"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: bold; src: local("Open Sans Bold"), url("./github/700.woff") format("woff"); }
@font-face { font-family: "Open Sans"; font-style: italic; font-weight: bold; src: local("Open Sans Bold Italic"), url("./github/700i.woff") format("woff"); }
html { font-size: 16px; }
body { font-family: "Open Sans", "Clear Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(51, 51, 51); line-height: 1.6; }
#write { max-width: 1280px; margin: 0px auto; padding: 20px 30px 100px; }
#write > ul:first-child, #write > ol:first-child { margin-top: 30px; }
body > :first-child { margin-top: 0px !important; }
body > :last-child { margin-bottom: 0px !important; }
a { color: rgb(65, 131, 196); }
h1, h2, h3, h4, h5, h6 { position: relative; margin-top: 1rem; margin-bottom: 1rem; font-weight: bold; line-height: 1.4; cursor: text; }
h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, h5:hover a.anchor, h6:hover a.anchor { text-decoration: none; }
h1 tt, h1 code { font-size: inherit; }
h2 tt, h2 code { font-size: inherit; }
h3 tt, h3 code { font-size: inherit; }
h4 tt, h4 code { font-size: inherit; }
h5 tt, h5 code { font-size: inherit; }
h6 tt, h6 code { font-size: inherit; }
h1 { padding-bottom: 0.3em; font-size: 2.25em; line-height: 1.2; border-bottom: 1px solid rgb(238, 238, 238); }
h2 { padding-bottom: 0.3em; font-size: 1.75em; line-height: 1.225; border-bottom: 1px solid rgb(238, 238, 238); }
h3 { font-size: 1.5em; line-height: 1.43; }
h4 { font-size: 1.25em; }
h5 { font-size: 1em; }
h6 { font-size: 1em; color: rgb(119, 119, 119); }
p, blockquote, ul, ol, dl, table { margin: 0.8em 0px; }
li > ol, li > ul { margin: 0px; }
hr { height: 2px; padding: 0px; margin: 16px 0px; background-color: rgb(231, 231, 231); border: 0px none; overflow: hidden; box-sizing: content-box; }
body > h2:first-child { margin-top: 0px; padding-top: 0px; }
body > h1:first-child { margin-top: 0px; padding-top: 0px; }
body > h1:first-child + h2 { margin-top: 0px; padding-top: 0px; }
body > h3:first-child, body > h4:first-child, body > h5:first-child, body > h6:first-child { margin-top: 0px; padding-top: 0px; }
a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 { margin-top: 0px; padding-top: 0px; }
h1 p, h2 p, h3 p, h4 p, h5 p, h6 p { margin-top: 0px; }
li p.first { display: inline-block; }
ul, ol { padding-left: 30px; }
ul:first-child, ol:first-child { margin-top: 0px; }
ul:last-child, ol:last-child { margin-bottom: 0px; }
blockquote { border-left: 4px solid rgb(223, 226, 229); padding: 0px 15px; color: rgb(119, 119, 119); }
blockquote blockquote { padding-right: 0px; }
table { padding: 0px; word-break: initial; }
table tr { border-top: 1px solid rgb(223, 226, 229); margin: 0px; padding: 0px; }
table tr:nth-child(2n), thead { background-color: rgb(248, 248, 248); }
table tr th { font-weight: bold; border-width: 1px 1px 0px; border-top-style: solid; border-right-style: solid; border-left-style: solid; border-top-color: rgb(223, 226, 229); border-right-color: rgb(223, 226, 229); border-left-color: rgb(223, 226, 229); border-image: initial; border-bottom-style: initial; border-bottom-color: initial; text-align: left; margin: 0px; padding: 6px 13px; }
table tr td { border: 1px solid rgb(223, 226, 229); text-align: left; margin: 0px; padding: 6px 13px; }
table tr th:first-child, table tr td:first-child { margin-top: 0px; }
table tr th:last-child, table tr td:last-child { margin-bottom: 0px; }
.CodeMirror-gutters { border-right: 1px solid rgb(221, 221, 221); }
.md-fences, code, tt { border: 1px solid rgb(223, 226, 229); background-color: rgb(248, 248, 248); border-radius: 3px; font-family: Consolas, "Liberation Mono", Courier, monospace; padding: 2px 4px 0px; font-size: 0.9em; }
.md-fences { margin-bottom: 15px; margin-top: 15px; padding: 8px 1em 6px; }
.md-task-list-item > input { margin-left: -1.3em; }
@media screen and (min-width: 914px) {
}
@media print {
  html { font-size: 13px; }
  table, pre { break-inside: avoid; }
  pre { word-wrap: break-word; }
}
.md-fences { background-color: rgb(248, 248, 248); }
#write pre.md-meta-block { padding: 1rem; font-size: 85%; line-height: 1.45; background-color: rgb(247, 247, 247); border: 0px; border-radius: 3px; color: rgb(119, 119, 119); margin-top: 0px !important; }
.mathjax-block > .code-tooltip { bottom: 0.375rem; }
#write > h3.md-focus::before { left: -1.5625rem; top: 0.375rem; }
#write > h4.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
#write > h5.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
#write > h6.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
.md-image > .md-meta { border-radius: 3px; font-family: Consolas, "Liberation Mono", Courier, monospace; padding: 2px 0px 0px 4px; font-size: 0.9em; color: inherit; }
.md-tag { color: inherit; }
.md-toc { margin-top: 20px; padding-bottom: 20px; }
.sidebar-tabs { border-bottom: none; }
#typora-quick-open { border: 1px solid rgb(221, 221, 221); background-color: rgb(248, 248, 248); }
#typora-quick-open-item { background-color: rgb(250, 250, 250); border-color: rgb(254, 254, 254) rgb(229, 229, 229) rgb(229, 229, 229) rgb(238, 238, 238); border-style: solid; border-width: 1px; }
#md-notification::before { top: 10px; }
.on-focus-mode blockquote { border-left-color: rgba(85, 85, 85, 0.12); }
header, .context-menu, .megamenu-content, footer { font-family: "Segoe UI", Arial, sans-serif; }
.file-node-content:hover .file-node-icon, .file-node-content:hover .file-node-open-state { visibility: visible; }
.mac-seamless-mode #typora-sidebar { background-color: var(--side-bar-bg-color); }
.md-lang { color: rgb(180, 101, 77); }
.html-for-mac .context-menu { --item-hover-bg-color: #E6F0FE; }





 .typora-export p, .typora-export .footnote-line {white-space: normal;} 
</style>
</head>
<body class='typora-export os-windows' >
<div  id='write'  class = 'is-node'><h1><a name='header-n0' class='md-header-anchor '></a>tums-player 使用说明</h1><div class='md-toc' mdtype='toc'><p class="md-toc-content"><span class="md-toc-item md-toc-h1" data-ref="n0"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n0">tums-player 使用说明</a></span><span class="md-toc-item md-toc-h2" data-ref="n37"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n37">1. 简介</a></span><span class="md-toc-item md-toc-h2" data-ref="n54"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n54">2. 使用方法</a></span><span class="md-toc-item md-toc-h3" data-ref="n55"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n55">2.1 正式部署</a></span><span class="md-toc-item md-toc-h2" data-ref="n69"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n69">3. 代码示例——demo.html</a></span><span class="md-toc-item md-toc-h2" data-ref="n84"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n84">4. 使用说明</a></span><span class="md-toc-item md-toc-h3" data-ref="n109"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n109">4.1 参数</a></span><span class="md-toc-item md-toc-h4" data-ref="n110"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n110">4.1.1 通用</a></span><span class="md-toc-item md-toc-h4" data-ref="n182"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n182">4.1.2 预览</a></span><span class="md-toc-item md-toc-h4" data-ref="n200"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n200">4.1.3 回放</a></span><span class="md-toc-item md-toc-h4" data-ref="n259"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n259">4.1.4 获取设备能力集</a></span><span class="md-toc-item md-toc-h4" data-ref="n318"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n318">4.1.5 鱼眼</a></span><span class="md-toc-item md-toc-h3" data-ref="n341"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n341">4.2 事件</a></span><span class="md-toc-item md-toc-h3" data-ref="n399"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n399">4.3 方法</a></span><span class="md-toc-item md-toc-h4" data-ref="n400"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n400">4.3.1 通用</a></span><span class="md-toc-item md-toc-h4" data-ref="n487"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n487">4.3.2 回放</a></span><span class="md-toc-item md-toc-h4" data-ref="n504"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n504">4.3.3 对讲</a></span><span class="md-toc-item md-toc-h4" data-ref="n534"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n534">4.3.4 录制</a></span><span class="md-toc-item md-toc-h4" data-ref="n556"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n556">4.3.5 云台</a></span><span class="md-toc-item md-toc-h4" data-ref="n658"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n658">4.3.6 获取设备能力集</a></span><span class="md-toc-item md-toc-h4" data-ref="n670"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n670">4.3.7 鱼眼</a></span><span class="md-toc-item md-toc-h4" data-ref="n682"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n682">4.3.8 设备控制</a></span><span class="md-toc-item md-toc-h3" data-ref="n720"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n720">4.4 示例</a></span><span class="md-toc-item md-toc-h4" data-ref="n721"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n721">4.4.1 预览</a></span><span class="md-toc-item md-toc-h5" data-ref="n722"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n722">4.4.1.1 示例 -- 预览</a></span><span class="md-toc-item md-toc-h4" data-ref="n724"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n724">4.4.2 回放</a></span><span class="md-toc-item md-toc-h5" data-ref="n725"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n725">4.4.2.1 示例 -- 回放</a></span><span class="md-toc-item md-toc-h4" data-ref="n727"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n727">4.4.3 对讲</a></span><span class="md-toc-item md-toc-h5" data-ref="n728"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n728">4.4.3.1 示例 -- 开始对讲</a></span><span class="md-toc-item md-toc-h5" data-ref="n730"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n730">4.4.3.2 示例 -- 结束对讲</a></span><span class="md-toc-item md-toc-h4" data-ref="n732"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n732">4.4.4 云台</a></span><span class="md-toc-item md-toc-h5" data-ref="n733"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n733">4.4.4.1 示例 -- 获取云台（ptz）能力集</a></span><span class="md-toc-item md-toc-h5" data-ref="n735"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n735">4.4.4.2 示例 -- 设置云台转向和调焦</a></span><span class="md-toc-item md-toc-h5" data-ref="n737"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n737">4.4.4.3 示例 -- 获取预置点</a></span><span class="md-toc-item md-toc-h5" data-ref="n739"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n739">4.4.4.4 示例 -- 操作预置点</a></span><span class="md-toc-item md-toc-h5" data-ref="n741"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n741">4.4.4.5 示例 -- 运动到预置点</a></span><span class="md-toc-item md-toc-h5" data-ref="n743"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n743">4.4.4.6 示例 -- 删除预置点</a></span><span class="md-toc-item md-toc-h5" data-ref="n745"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n745">4.4.4.7 示例 -- 云台复位</a></span><span class="md-toc-item md-toc-h5" data-ref="n747"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n747">4.4.4.8 示例 -- 获取巡航路径</a></span><span class="md-toc-item md-toc-h5" data-ref="n749"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n749">4.4.4.9 示例 -- 操作巡航路径</a></span><span class="md-toc-item md-toc-h5" data-ref="n751"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n751">4.4.4.10 示例 -- 播放巡航路径</a></span><span class="md-toc-item md-toc-h5" data-ref="n753"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n753">4.4.4.11 示例 -- 删除巡航路径</a></span><span class="md-toc-item md-toc-h5" data-ref="n755"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n755">4.4.4.12 示例 -- 守望</a></span><span class="md-toc-item md-toc-h4" data-ref="n757"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n757">4.4.5 设备控制</a></span><span class="md-toc-item md-toc-h5" data-ref="n758"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n758">4.4.5.1 示例 -- 镜头遮蔽</a></span><span class="md-toc-item md-toc-h5" data-ref="n760"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n760">4.4.5.2 示例 -- 画面镜像</a></span><span class="md-toc-item md-toc-h5" data-ref="n762"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n762">4.4.5.3 示例 -- 画面旋转</a></span><span class="md-toc-item md-toc-h2" data-ref="n764"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n764">5. 接入TP-LINK商用云平台指南</a></span><span class="md-toc-item md-toc-h3" data-ref="n789"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n789">5.1 预览流程</a></span><span class="md-toc-item md-toc-h3" data-ref="n799"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n799">5.2 回放流程</a></span><span class="md-toc-item md-toc-h2" data-ref="n809"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n809">6. 附录</a></span><span class="md-toc-item md-toc-h3" data-ref="n810"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n810">6.1 错误码</a></span><span class="md-toc-item md-toc-h3" data-ref="n996"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n996">6.2 事件类型约束</a></span><span class="md-toc-item md-toc-h3" data-ref="n1128"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n1128">6.3 云台能力集</a></span><span class="md-toc-item md-toc-h4" data-ref="n1129"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n1129">6.3.1 Ptz</a></span><span class="md-toc-item md-toc-h4" data-ref="n1379"><a class="md-toc-inner" style="cursor: pointer;" href="#header-n1379">6.3.2 Motor</a></span></p></div><figure><table><thead><tr><th>文档版本</th><th>备注</th></tr></thead><tbody><tr><td>v1.0.0</td><td>1. 创建文档<br />2. 支持预览功能</td></tr><tr><td>V1.1.0</td><td>1. 增加商云接口调用流程<br />2. 增加回放功能相关参数和方法</td></tr><tr><td>V1.2.0</td><td>1. 增加语音对讲相关参数和方法</td></tr><tr><td>V1.3.0</td><td>1. 增加本地平台回放功能</td></tr><tr><td>V1.4.0</td><td>1. 增加鱼眼画面显示模式相关参数和方法</td></tr><tr><td>V1.5.0</td><td>1. 增加云台功能相关参数和方法</td></tr><tr><td>V1.5.1</td><td>1. 补充语音对讲详细参数说明</td></tr><tr><td>V2.0.0</td><td>1. 增加webcodecs解码方案及相关参数配置</td></tr><tr><td>V2.0.1</td><td>1. 增加画面旋转、镜头遮蔽、画面镜像功能</td></tr><tr><td>V2.0.11</td><td>1. 适配商云开放平台接口，并调整部分对外开放的功能说明</td></tr></tbody></table></figure><h2><a name='header-n37' class='md-header-anchor '></a>1. 简介</h2><p>tums-player是基于TP-LINK平台封装的视频播放组件，使用过程中不必学习专业的业务概念，更不用调用繁琐的接口，能够以极简的嵌入方式，快速在应用中集成视频功能。</p><p>覆盖的平台包含：PC端web</p><p>浏览器支持：</p><ul><li>Chrome 60+</li><li>FireFox 55+</li><li>Edge 79+</li></ul><h2><a name='header-n54' class='md-header-anchor '></a>2. 使用方法</h2><h3><a name='header-n55' class='md-header-anchor '></a>2.1 正式部署</h3><ol start='' ><li>下载tums-player</li><li>将压缩包移至服务器或前端项目后解压，需注意播放器资源路径要求为xxx/tums-player/</li><li>参照代码示例开发页面</li><li>运行服务器使用</li></ol><h2><a name='header-n69' class='md-header-anchor '></a>3. 代码示例——demo.html</h2><p><strong>创建dom</strong></p><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="html"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tag cm-bracket">&lt;</span><span class="cm-tag">html</span><span class="cm-tag cm-bracket">&gt;</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-tag cm-bracket">&lt;</span><span class="cm-tag">body</span><span class="cm-tag cm-bracket">&gt;</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-tag cm-bracket">&lt;</span><span class="cm-tag">div</span> <span class="cm-attribute">id</span>=<span class="cm-string">"video-container"</span><span class="cm-tag cm-bracket">&gt;&lt;/</span><span class="cm-tag">div</span><span class="cm-tag cm-bracket">&gt;</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-tag cm-bracket">&lt;/</span><span class="cm-tag">body</span><span class="cm-tag cm-bracket">&gt;</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tag cm-bracket">&lt;/</span><span class="cm-tag">html</span><span class="cm-tag cm-bracket">&gt;</span></span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 123px;"></div><div class="CodeMirror-gutters" style="display: none; height: 123px;"></div></div></div></pre><p><strong>引入sdk</strong></p><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="html"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">&lt;!-- 假设sdk在/static/tums-player/路径下 --&gt;</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tag cm-bracket">&lt;</span><span class="cm-tag">script</span> <span class="cm-attribute">src</span>=<span class="cm-string">"/static/tums-player/tums-player.umd.min.js"</span><span class="cm-tag cm-bracket">&gt;&lt;/</span><span class="cm-tag">script</span><span class="cm-tag cm-bracket">&gt;</span></span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 54px;"></div><div class="CodeMirror-gutters" style="display: none; height: 54px;"></div></div></div></pre><p><strong>初始化播放器</strong></p><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="html" style="break-inside: unset;"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><span><span>​</span>x</span></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tag cm-bracket">&lt;</span><span class="cm-tag">script</span><span class="cm-tag cm-bracket">&gt;</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-keyword">var</span> <span class="cm-def">TumsPlayer</span> <span class="cm-operator">=</span> <span class="cm-variable">window</span>[<span class="cm-string">'tums-player'</span>].<span class="cm-property">default</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-comment">// 预览初始化必填字段</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-keyword">var</span> <span class="cm-def">player</span> <span class="cm-operator">=</span> <span class="cm-keyword">new</span> <span class="cm-variable">TumsPlayer</span>(<span class="cm-string">'video-container'</span>, {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-property">type</span>: <span class="cm-string">'relay'</span>, <span class="cm-comment">// 协议类型relay</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-property">url</span>: <span class="cm-string">'https://xxx/requestRelayUrl?token=xxx'</span>, <span class="cm-comment">// 取流地址</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-property">pluginPath</span>: <span class="cm-string">'/static'</span>, <span class="cm-comment">// 当sdk资源不在根路径下时，需配置pluginPath</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-property">appKey</span>: <span class="cm-string">''</span>, <span class="cm-comment">// 从商云平台获取的鉴权信息</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-property">appSecret</span>: <span class="cm-string">''</span> <span class="cm-comment">// 从商云平台获取的鉴权信息</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  });</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-comment">// 回放必填字段</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-keyword">var</span> <span class="cm-def">player</span> <span class="cm-operator">=</span> <span class="cm-keyword">new</span> <span class="cm-variable">TumsPlayer</span>(<span class="cm-string">'video-container'</span>, {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-property">type</span>: <span class="cm-string">'relay'</span>, <span class="cm-comment">// 协议类型relay</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-property">url</span>: <span class="cm-string">'https://xxx/requestRelayUrl?token=xxx'</span>, <span class="cm-comment">// 取流地址</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-property">pluginPath</span>: <span class="cm-string">'/static'</span>, <span class="cm-comment">// 当sdk资源不在根路径下时，需配置pluginPath</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-property">appKey</span>: <span class="cm-string">''</span>, <span class="cm-comment">// 从商云平台获取的鉴权信息</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-property">appSecret</span>: <span class="cm-string">''</span>, <span class="cm-comment">// 从商云平台获取的鉴权信息</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-property">userId</span>: <span class="cm-string">''</span>, <span class="cm-comment">// searchVideo接口返回的用户id</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-property">startTime</span>: <span class="cm-string">''</span> <span class="cm-comment">// 回放开始时间戳，默认今天0点</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  });</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tag cm-bracket">&lt;/</span><span class="cm-tag">script</span><span class="cm-tag cm-bracket">&gt;</span></span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 537px;"></div><div class="CodeMirror-gutters" style="display: none; height: 537px;"></div></div></div></pre><p><strong>方法调用</strong></p><p>示例：</p><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="javascript"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span>.<span class="cm-property">start</span>(); <span class="cm-comment">// 开始播放(autoplay为false时可调用此方法)</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span>.<span class="cm-property">pause</span>(); <span class="cm-comment">// 暂停</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span>.<span class="cm-property">play</span>(); <span class="cm-comment">// 继续播放</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span>.<span class="cm-property">destroy</span>().<span class="cm-property">then</span>(() <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// do something</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}); <span class="cm-comment">// 销毁</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span>.<span class="cm-property">on</span>(<span class="cm-string">'ready'</span>, (<span class="cm-def">evt</span>) <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">console</span>.<span class="cm-property">log</span>(<span class="cm-variable-2">evt</span>.<span class="cm-property">detail</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}); <span class="cm-comment">// 事件监听</span></span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 216px;"></div><div class="CodeMirror-gutters" style="display: none; height: 216px;"></div></div></div></pre><h2><a name='header-n84' class='md-header-anchor '></a>4. 使用说明</h2><p>前置说明：</p><p>播放器基本通过实例对象进行操作，需要首先调用构造函数，传递必要参数，然后再进行其他操作。</p><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang=""><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">let playerInstance = new window.TumsPlayer(node, options);</span></pre></div></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 31px;"></div><div class="CodeMirror-gutters" style="display: none; height: 31px;"></div></div></div></pre><figure><table><thead><tr><th>参数</th><th>说明</th><th>类型</th><th>可选值</th><th>默认值</th></tr></thead><tbody><tr><td>node</td><td>播放器（canvas）画布外层容器<br />可为元素id或实际元素对象</td><td>String/HTMLElement</td><td>--</td><td>--</td></tr><tr><td>options</td><td>SDK参数，具体见后文说明</td><td>Object</td><td>--</td><td>--</td></tr></tbody></table></figure><h3><a name='header-n109' class='md-header-anchor '></a>4.1 参数</h3><h4><a name='header-n110' class='md-header-anchor '></a>4.1.1 通用</h4><figure><table><thead><tr><th>参数</th><th>说明</th><th>类型</th><th>可选值</th><th>默认值</th><th>是否必选</th></tr></thead><tbody><tr><td>type</td><td>视频流类型：传递relay即可</td><td>String</td><td>rtsp/relay</td><td>rtsp</td><td>Y</td></tr><tr><td>url</td><td>取流地址：TP-LINK商用云平台通过提供的requestStreamUrl接口获取</td><td>String</td><td>--</td><td>--</td><td>Y</td></tr><tr><td>decoderType</td><td>解码类型：<br />(1) wasm：webAssembly软解；<br />(2) webcodecs：webcodecsApi硬解，仅少数浏览器支持。<br />注：建议不传，由SDK内部自动判断即可</td><td>String</td><td>wasm/webcodecs</td><td>--</td><td>N</td></tr><tr><td>pluginPath</td><td>sdk资源地址，默认是在根路径下。<br />比如sdk路径为/static/tums-player，则pluginPath值为/static。</td><td>String</td><td>--</td><td>&#39;/&#39;</td><td>N</td></tr><tr><td>autoplay</td><td>自动播放</td><td>Boolean</td><td>true/false</td><td>false</td><td>N</td></tr><tr><td>cover</td><td>显示的画面是否覆盖父节点宽高，默认按画面原始比例显示</td><td>Boolean</td><td>true/false</td><td>false</td><td>N</td></tr><tr><td>streamType</td><td>流类型：<br />video：预览<br />sdvod：回放</td><td>String</td><td>video/sdvod</td><td>video</td><td>N</td></tr><tr><td>screenshotEnable</td><td>截图使能</td><td>Boolean</td><td>true/false</td><td>true</td><td>N</td></tr><tr><td>volume</td><td>音量</td><td>Number</td><td>[1, 100]</td><td>50</td><td>N</td></tr></tbody></table></figure><h4><a name='header-n182' class='md-header-anchor '></a>4.1.2 预览</h4><p>options额外传递参数说明：</p><figure><table><thead><tr><th>参数</th><th>说明</th><th>类型</th><th>可选值</th><th>默认值</th><th>是否必选</th></tr></thead><tbody><tr><td>resolution</td><td>分辨率：VGA：子码流；<br />HD：主码流<br />注：初始传入此值仅用于标记当前实例的分辨率，实际播放效果以url为准</td><td>String</td><td>VGA/HD</td><td>&#39;&#39;</td><td>N</td></tr></tbody></table></figure><h4><a name='header-n200' class='md-header-anchor '></a>4.1.3 回放</h4><p><strong>options额外传递参数说明：</strong></p><figure><table><thead><tr><th>参数</th><th>说明</th><th>类型</th><th>可选值</th><th>默认值</th><th>是否必选</th></tr></thead><tbody><tr><td>userId</td><td>searchVideo接口返回的用户id，回放必传</td><td>Number</td><td>--</td><td>--</td><td>Y</td></tr><tr><td>startTime</td><td>回放开始时间戳（见表后注1）</td><td>Number</td><td>--</td><td>当天00:00</td><td>N</td></tr><tr><td>endTime</td><td>回放结束时间戳</td><td>Number</td><td>--</td><td>--</td><td>N</td></tr><tr><td>eventType</td><td>回放事件类型</td><td>Number[]</td><td>见表后注2</td><td>[1, 2]</td><td>N</td></tr><tr><td>scale</td><td>回放倍速</td><td>Number</td><td>[0.0625, 0.125, 0.25, 0.5, 1, 2, 4, 8, 16]</td><td>1</td><td>N</td></tr></tbody></table></figure><ul><li><p>注1：时间戳指从1970年1月1日开始所经过的毫秒数。（即13位时间戳）</p></li><li><p>注2：事件类型定义，需要区分直连IPC和NVR通道。</p><p>直连IPC（取值范围见6.2）：
数组包含指定事件类型即可。eg: [1, 2, 3] 表示同时回放定时、移动侦测和遮挡侦测类型。</p><p>NVR通道：
目前仅支持：1 定时类型，2 动检类型。传值[1]表示只回放定时类型，[2]表示只回放动检类型，[1, 2]表示同时回放两种类型。</p></li></ul><h4><a name='header-n259' class='md-header-anchor '></a>4.1.4 获取设备能力集</h4><p><strong>options额外传递参数说明：</strong></p><figure><table><thead><tr><th>参数</th><th>说明</th><th>类型</th><th>可选值</th><th>默认值</th><th>是否必选</th></tr></thead><tbody><tr><td>parentQrCode</td><td>nvr设备二维码</td><td>String</td><td>-</td><td>-</td><td>ipc通过nvr接入时需传递</td></tr><tr><td>qrCode</td><td>ipc设备二维码</td><td>String</td><td>-</td><td>-</td><td>直连ipc需传递</td></tr><tr><td>channelId</td><td>ipc通道号</td><td>Number</td><td>-</td><td>1</td><td>Y</td></tr></tbody></table></figure><p><strong>options鉴权相关参数说明：</strong></p><figure><table><thead><tr><th>参数</th><th>说明</th><th>类型</th><th>可选值</th><th>默认值</th><th>是否必选</th></tr></thead><tbody><tr><td>appKey</td><td>ak信息</td><td>String</td><td>--</td><td>&#39;&#39;</td><td>Y</td></tr><tr><td>appSecret</td><td>sk信息</td><td>String</td><td>--</td><td>&#39;&#39;</td><td>Y</td></tr></tbody></table></figure><blockquote><p>ak/sk为鉴权所需参数，如果想要使用能力集，设备控制功能，则必须传递，具体值可在商云中获取。</p></blockquote><h4><a name='header-n318' class='md-header-anchor '></a>4.1.5 鱼眼</h4><p>需要设备支持鱼眼才可正常运行。</p><blockquote><p>注：为避免操作问题，请提前获取设备能力集(详情见4.1.4和4.3.5)，以确定预览设备支持鱼眼功能。</p></blockquote><p>options额外传递参数说明：</p><figure><table><thead><tr><th>参数</th><th>说明</th><th>类型</th><th>可选值</th><th>默认值</th><th>是否必选</th></tr></thead><tbody><tr><td>fishEyeDisplayMode</td><td>鱼眼画面显示模式</td><td>String</td><td>&#39;ORIGIN&#39;: 原图；<br />‘FISHEYE_360D’：顶装360度全景；<br />‘FISHEYE_180D’：顶装180度全景；<br />‘FISHEYE_WIN_PLANE_TOP_QUAD’：顶装四分屏；<br />‘FISHEYE_LONGITUDE’：壁装全景拉伸；</td><td>‘ORIGIN’</td><td>N</td></tr></tbody></table></figure><h3><a name='header-n341' class='md-header-anchor '></a>4.2 事件</h3><p>以下是SDK完整事件列表：</p><figure><table><thead><tr><th>事件</th><th>说明</th><th>回调参数</th></tr></thead><tbody><tr><td>ready</td><td>当播放器实例化完成时触发</td><td>event:  {detail:  player实例 }</td></tr><tr><td>play</td><td>当媒介数据将要开始播放时触发</td><td>event:  {detail:  player实例 }</td></tr><tr><td>pause</td><td>当媒介数据暂停时触发</td><td>event:  {detail:  player实例 }</td></tr><tr><td>stream</td><td>开始推流时触发</td><td>event:  {detail:  player实例 }</td></tr><tr><td>playing</td><td>当媒介数据已开始播放时触发</td><td>event:  {detail:  player实例 }</td></tr><tr><td>error</td><td>发生错误时触发</td><td>event:  {detail: {code: 0, message: &#39;&#39;, type: &#39;audio&#39;/&#39;video&#39;}}，code详见错误码列表， type默认为video</td></tr><tr><td>warning</td><td>发生警告时触发</td><td>event:  {detail: {code: 0, message: &#39;&#39;}}，code详见错误码列表</td></tr><tr><td>disconnected</td><td>与服务器断开连接时触发</td><td>event: { detail: { code: 0, reason: &#39;&#39; } }</td></tr><tr><td>ended</td><td>当媒介数据播放结束时触发</td><td>event:  {detail:  player实例 }</td></tr><tr><td>zoom</td><td>当画面放大时触发</td><td>event:  {detail: {scale:  放大的倍率，见表后注1 } }</td></tr><tr><td>videoRecordFinished</td><td>录制文件下载时触发，目前录制超过10min将会自动下载</td><td>无</td></tr></tbody></table></figure><ul><li>注1：
进入电子放大状态后，在画面中单击鼠标左键放大画面，右键缩小画面，也可使用滚轮操作；
放大范围：[1, 5]，粒度为0.25。</li></ul><h3><a name='header-n399' class='md-header-anchor '></a>4.3 方法</h3><h4><a name='header-n400' class='md-header-anchor '></a>4.3.1 通用</h4><figure><table><thead><tr><th>方法</th><th>说明</th><th>参数</th><th>返回值</th></tr></thead><tbody><tr><td>init</td><td>播放器初始化</td><td>同options</td><td>无</td></tr><tr><td>destroy</td><td>播放器销毁</td><td>无</td><td>Promise</td></tr><tr><td>start</td><td>开始播放</td><td>无</td><td>无</td></tr><tr><td>stop</td><td>停止播放</td><td>无</td><td>无</td></tr><tr><td>pause</td><td>暂停播放</td><td>无</td><td>无</td></tr><tr><td>play</td><td>继续播放</td><td>无</td><td>无</td></tr><tr><td>fullscreen</td><td>全屏放大</td><td>(controlEl: HtmlDomElement, forceRotate: Boolean)<br />controlEl: 全屏放大后在画面中插入的dom节点，可选<br />forceRotate: 是否强制横屏，默认为false</td><td>无</td></tr><tr><td>exitFullscreen</td><td>退出全屏</td><td>无</td><td>无</td></tr><tr><td>screenshot</td><td>视频截图</td><td>(download: Boolean)<br />download: 是否自动下载截图，默认为true</td><td>base64格式图片数据，png格式</td></tr><tr><td>on</td><td>监听事件，与事件列表对应</td><td>(eventName: String, callback: Function)</td><td>无</td></tr><tr><td>off</td><td>注销事件</td><td>(eventName: String, callback: Function)</td><td>无</td></tr><tr><td>toggleZoomState</td><td>切换电子放大状态（见注3）</td><td>(state: Number)<br />state: <br />1，进入放大状态；<br />0，退出放大状态</td><td>无</td></tr><tr><td>setZoomScale</td><td>设置放大倍率</td><td>(scale: Number)<br />scale: 取值[1, 5]，超过范围的值不生效</td><td>无</td></tr><tr><td>playAudio</td><td>移动端需在用户操作页面触发touch等事件后，在事件回调中执行此方法开始播放音频</td><td>无</td><td>无</td></tr><tr><td>getVolume</td><td>获取当前播放音量</td><td>无</td><td>volume: Number</td></tr><tr><td>setVolume</td><td>设置播放音量</td><td>(volume: Number)<br />volume: 取值[0, 100]</td><td>无</td></tr></tbody></table></figure><h4><a name='header-n487' class='md-header-anchor '></a>4.3.2 回放</h4><figure><table><thead><tr><th>方法</th><th>说明</th><th>参数</th><th>返回值</th></tr></thead><tbody><tr><td>setPlaybackConfig</td><td>设置回放参数</td><td>(options: Object)<br />options参数内容如下<br />startTime、endTime、scale、eventType（可任意组合）</td><td>无</td></tr><tr><td>getPlaybackTime</td><td>获取当前回放时间戳</td><td>无</td><td>timestamp：Number<br />13位时间戳</td></tr></tbody></table></figure><h4><a name='header-n504' class='md-header-anchor '></a>4.3.3 对讲</h4><blockquote><p>注：为避免操作问题，请提前获取对讲能力集（第一个方法），以确定预览设备支持相关功能。</p></blockquote><figure><table><thead><tr><th>方法</th><th>说明</th><th>参数</th><th>返回值</th></tr></thead><tbody><tr><td>getTalkCapability</td><td>获取对讲能力集</td><td>无</td><td>Promise<br />失败时将返回error_code信息<br />成功时返回result。<br/>result.talkSupport（Boolean）：是否支持对讲。true表示支持，false表示不支持<br>result.microphoneCapability（Object）：麦克风能力集<br/>result.speakerCapability（Object）：扬声器能力集</td></tr><tr><td>getMicrophoneCapability</td><td>获取麦克风能力集</td><td>无</td><td>Promise<br />失败时将返回error_code信息<br />成功时返回result（麦克风能力集）。</td></tr><tr><td>startVoiceIntercom</td><td>开始语音对讲</td><td>voiceOptions: (Object)，参数内容如下：<br />url（String）：必选，通过requestStreamUrl接口获取的语音对接地址<br/>mode（String）：通话模式，取值如下：<br/>half_duplex：半双工模式<br/>vad：VAD人声检测模式<br/>aec：AEC全双工模式<br/>默认为aec（双向语音对讲）。</td><td>无</td></tr><tr><td>stopVoiceIntercom</td><td>停止语音对讲</td><td>无</td><td>无</td></tr></tbody></table></figure><h4><a name='header-n534' class='md-header-anchor '></a>4.3.4 录制</h4><figure><table><thead><tr><th>方法</th><th>说明</th><th>参数</th><th>返回值</th></tr></thead><tbody><tr><td>startRecording</td><td>开启预览录像。受浏览器内存限制，建议录像时间不超过10分钟</td><td>(options: Object)<br />options参数内容如下<br />micStream: Boolean，是否录制麦克风声音，默认false</td><td>Promise<br />开始录像后resolve</td></tr><tr><td>stopRecording</td><td>停止预览录像并下载录像文件</td><td>(fileName: String, download: Boolean)<br />fileName: 文件名，最终下载文件名格式为<code>${文件名}_${时间戳}.webm</code><br />download: 是否自动下载文件，默认true</td><td>Promise<br />返回录像文件blob类型数据</td></tr><tr><td>getRecordInfo</td><td>获取预览录像信息</td><td>无</td><td>recordInfo: Object<br />包含参数内容如下：<br />time: 录像时间，单位毫秒<br />size: 录像文件大小，单位kb</td></tr></tbody></table></figure><h4><a name='header-n556' class='md-header-anchor '></a>4.3.5 云台</h4><p>云台目前支持的功能有：转动、调焦、守望、预置点操作、运动到相应预置点、云台复位、巡航路径操作、播放巡航路径</p><blockquote><p>注：为避免操作问题，请提前获取云台能力集（前两个方法），以确定预览设备支持相关功能。</p></blockquote><figure><table><thead><tr><th>方法</th><th>说明</th><th>参数</th><th>返回值</th></tr></thead><tbody><tr><td>getDeviceType</td><td>获取云台（ptz）能力集</td><td>无</td><td>Promise<br />失败时将返回error_code信息<br />成功时返回result（云台能力集）。</td></tr><tr><td>getMotorCapability</td><td>获取云台（motor）能力集</td><td>无</td><td>Promise<br />失败时将返回error_code信息<br />成功时返回result（云台能力集）。</td></tr><tr><td>getFocusCapability</td><td>获取聚焦能力集</td><td>无</td><td>Promise<br />失败时将返回error_code信息<br />成功时返回result。<br/>result.focusSupported（String）：是否支持聚焦。&quot;1&quot;表示支持，&quot;0&quot;或缺失该字段表示不支持。<br>result.focusLimitedRange（<code>Array&lt;string&gt;</code>）：支持聚焦功能的机型最小焦距合法取值范围。</td></tr><tr><td>getDeviceZoomSupport</td><td>获取变焦能力集</td><td>无</td><td>Promise<br />失败时将返回error_code信息<br />成功时返回result。<br/>result.zoomSupport（Boolean）：是否支持变焦。true表示支持，false表示不支持</td></tr><tr><td>setPtzParams</td><td>设置云台的转向和调焦</td><td>options: (Object)，参数内容如下：<br />direction（int）：必选，云台操作类型<br>取值：<br>0：停止<br />1：向右<br />2：右下<br />3：向下<br />4：左下<br />5：向左<br />6：左上<br />7：向上<br />8：右上<br />9：扫描<br />10：变倍+<br />11：变倍-<br />12：调焦+<br />13：调焦-<br />14：调焦停止<br />15：云台复位<br />speed（int）：可选，云台速度大小，取值范围：[1, 7]</td><td>Promise<br />根据返回的error_code信息判断设置成功或者失败</td></tr><tr><td>getAllPresets</td><td>获取预置点</td><td>无</td><td>Promise<br />失败时将返回error_code信息<br />成功时可从 result（<code>Array&lt;object&gt;</code>）中取得预置点列表。<br>result[idx].presetId：预置点唯一的标识符<br>result[idx].name：预置点的名称<br/>result[idx].readOnly：是否为预设功能的只读的预置点，其中1为只读，0为可修改</td></tr><tr><td>operatePreset</td><td>增加或修改操作预置点</td><td>options: (Object)，参数内容如下：<br />presetId（String）：可选，预置点id。<br/>name（String）：可选，预置点的名称。<br/>override（String）：可选，修改预置点时是否覆盖预置点位置信息。<br/>取值：<br/>0：不覆盖位置信息<br/>1：覆盖位置信息</td><td>Promise<br />根据返回的error_code信息判断设置成功或者失败</td></tr><tr><td>executePreset</td><td>运动到预置点</td><td>options: (Object)，参数内容如下：<br />presetId（string）：必选，预置点id。</td><td>Promise<br />根据返回的error_code信息判断设置成功或者失败</td></tr><tr><td>deletePreset</td><td>删除预置点</td><td>options: (Object)，参数内容如下：<br />presetId（string）：必选，预置点id。</td><td>Promise<br />根据返回的error_code信息判断设置成功或者失败</td></tr><tr><td>addPresetPoint</td><td>添加预置点</td><td>options: (Object)，参数内容如下：<br />presetId（String）：可选，预置点id。<br/>presetName（String）：可选，预置点的名称。<br/>override（String）：可选，修改预置点时是否覆盖预置点位置信息。<br/>取值：<br/>0：不覆盖位置信息<br/>1：覆盖位置信息</td><td>Promise<br />根据返回的error_code信息判断设置成功或者失败</td></tr><tr><td>resetPtzDevicePosition</td><td>云台复位</td><td>无</td><td>Promise<br />根据返回的error_code信息判断设置成功或者失败</td></tr><tr><td>getPtzDeviceResetSupport</td><td>判断云台是否支持复位</td><td>无</td><td>Promise<br />失败时将返回error_code信息<br />成功时返回result。<br/>result.positionResetSupport（Boolean）：是否支持位置复位。true表示支持，false表示不支持</td></tr><tr><td>getAllTours</td><td>获取巡航扫描</td><td>无</td><td>Promise<br />失败时将返回error_code信息<br />成功时返回result。<br/>result.maxTourNumber（int）：最大支持的巡航路径个数。<br>result.tourIds（<code>Array&lt;string&gt;</code>）：巡航路径id列表。（与tourNames、tourStates一一对应）<br/>result.tourNames（<code>Array&lt;string&gt;</code>）：巡航路径名称<br/>result.tourStates（<code>Array&lt;string&gt;</code>）：巡航状态，取值如下<br/>idle：不在巡航<br>touring：正在巡航<br>paused：巡航暂停</td></tr><tr><td>getToursInfo</td><td>获取巡航扫描的具体数据</td><td>options: (Object)，参数内容如下：<br />tourId（Array）：必选，巡航路径id列表。</td><td>Promise<br />失败时将返回error_code信息<br />成功时返回result。<br/>result.tourId（String）：巡航路径id<br/>result.presetIds（<code>Array&lt;string&gt;</code>）：预置点id列表，巡航路径中预置点的唯一标识符。<br>result.speedPans（<code>Array&lt;string&gt;</code>）：巡航到该预置点的水平方向速率。<br/>result.speedTilts（<code>Array&lt;string&gt;</code>）：巡航到该预置点的垂直方向速率。<br/>result.speedZooms（<code>Array&lt;string&gt;</code>）：巡航到该预置点的变焦速率。<br/>result.times（<code>Array&lt;string&gt;</code>）：预置点的停留时间，单位毫秒。</td></tr><tr><td>addCruisePath</td><td>添加、编辑巡航路径</td><td>options: (Object)，参数内容如下：<br />tourId（String）：必选，巡航路径id。<br>tourName（String）：可选，巡航路径名称。<br>presetIds（String）：可选，预置点id列表。<br>times（String）：可选，预置点的停留时间，应在云台能力集tour_stay_time_range范围内，单位毫秒。</td><td>Promise<br />根据返回的error_code信息判断设置成功或者失败</td></tr><tr><td>executeTour</td><td>播放巡航路径</td><td>options: (Object)，参数内容如下：<br />tourId（String）：必选，巡航路径id。<br/>action（String）：必选，操作类型，取值如下：<br>0：开始巡航/继续已经暂停的巡航<br>1：停止巡航<br/>2：暂停当前巡航</td><td>Promise<br />根据返回的error_code信息判断设置成功或者失败</td></tr><tr><td>deleteTour</td><td>删除巡航路径</td><td>options: (Object)，参数内容如下：<br />tourId（String）：必选，巡航路径id。</td><td>Promise<br />根据返回的error_code信息判断设置成功或者失败</td></tr><tr><td>startParkConfig</td><td>开启、关闭守望</td><td>options: (Object)，参数内容如下：<br />enabled（String）：必选，守望功能是否开启<br/>取值：<br>0：不开启<br>1：开启<br>parkTime（String）：可选，守望时间，单位为秒。取值范围在应在云台能力集的park_time_range范围内。<br>mode（String）：可选，守望模式<br/>取值：<br/>auto_scan：自动扫描<br/>frame_scan：帧扫描<br/>random_scan：随机扫描<br/>tour：巡航扫描<br/>preset：预置点<br/>pattern：花样扫描<br/>panorama_scan：全景扫描<br/>tilt_scan：垂直扫描<br/>actionId（String）：可选。当mode为tour，preset，pattern时，分别为为巡航路径、预置点和花样扫描的唯一标识符，actionMode为其它时无效。</td><td>Promise<br />根据返回的error_code信息判断设置成功或者失败</td></tr></tbody></table></figure><h4><a name='header-n658' class='md-header-anchor '></a>4.3.6 获取设备能力集</h4><figure><table><thead><tr><th>方法</th><th>说明</th><th>参数</th><th>返回值</th></tr></thead><tbody><tr><td>getModuleSpec</td><td>获取设备能力集，目前包含镜像、镜头遮蔽和鱼眼模式，画面旋转默认全部ipc均支持。</td><td>无</td><td>Promise<br />失败时返回相关error_code信息<br />成功时返回data<br />data.lensMaskEnable：镜头遮蔽使能<br />data.flipEnable：画面镜像使能<br />data.rotateEnable：画面旋转使能<br />data.fishEveEnable：鱼眼模式使能</td></tr></tbody></table></figure><h4><a name='header-n670' class='md-header-anchor '></a>4.3.7 鱼眼</h4><figure><table><thead><tr><th>方法</th><th>说明</th><th>参数</th><th>返回值</th></tr></thead><tbody><tr><td>setFishEyeDisplayMode</td><td>设置鱼眼画面显示模式</td><td>(mode: String)<br />枚举类型同options.fishEyeDisplayMode</td><td>无</td></tr></tbody></table></figure><h4><a name='header-n682' class='md-header-anchor '></a>4.3.8 设备控制</h4><p>设备控制功能目前仅支持<code>镜头遮蔽</code>、<code>画面镜像</code>、<code>画面旋转</code>。</p><blockquote><p>注：为避免操作问题，请提前获取设备能力集(详情见4.1.4和4.3.5)，以确定预览设备支持相关功能。
设备能力集所需的parentQrCode、qrCode、channelId也请按要求传递。</p></blockquote><figure><table><thead><tr><th>方法</th><th>说明</th><th>参数</th><th>返回值</th></tr></thead><tbody><tr><td>getLensMaskValue</td><td>获取镜头遮蔽状态</td><td>无</td><td>Promise<br />设备不支持时将返回error_code信息<br />设备支持时可从 result.enabled中取得具体状态</td></tr><tr><td>setLensMaskValue</td><td>设置镜头遮蔽状态</td><td>(maskStatus: Boolean)<br />true：遮蔽<br />false：不遮蔽</td><td>Promise<br />根据返回的error_code信息判断设置成功或者失败</td></tr><tr><td>getImageSwitch</td><td>获取图像切换配置，目前可包含镜像和画面旋转</td><td>无</td><td>Promise<br />失败时返回相关error_code信息<br />成功时可以通过result.flip和result.rotate分别取得镜像状态和旋转状态。</td></tr><tr><td>saveImageSwitch</td><td>设置图像切换配置，目前可包含镜像和画面旋转</td><td>(config: Object)<br />config.flip_type（Number）: 镜像状态<br />取值：<br />0：关闭<br />1：左右<br />2：上下<br />3：中心<br />config.rotate_type（Number）：旋转状态<br />0：关闭<br />1：逆时针旋转180°<br />2：顺时针旋转90°<br />3：逆时针旋转90°</td><td>Promise<br />根据返回的error_code信息判断设置成功或者失败</td></tr></tbody></table></figure><ul><li>注1：
error_code取值请参考商云开放平台，该api仅仅是对开放接口的封装，实际效果与开放接口并无差异。</li></ul><h3><a name='header-n720' class='md-header-anchor '></a>4.4 示例</h3><h4><a name='header-n721' class='md-header-anchor '></a>4.4.1 预览</h4><h5><a name='header-n722' class='md-header-anchor '></a>4.4.1.1 示例 -- 预览</h5><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="js" style="break-inside: unset;"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 初始化player</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">const</span> <span class="cm-def">TumsPlayer</span> <span class="cm-operator">=</span> <span class="cm-variable">window</span>[<span class="cm-string">'tums-player'</span>].<span class="cm-property">default</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span> <span class="cm-operator">=</span> <span class="cm-keyword">new</span> <span class="cm-variable">TumsPlayer</span>(<span class="cm-variable">document</span>.<span class="cm-property">querySelector</span>(<span class="cm-string">'#container'</span>), {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-property">type</span>: <span class="cm-string">'relay'</span>, <span class="cm-comment">// 协议类型</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-property">url</span>: <span class="cm-string">'https://xxxxxx'</span>, <span class="cm-comment">// requestStreamUrl获取的预览url</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-property">pluginPath</span>: <span class="cm-string">'/master'</span>, <span class="cm-comment">// 当sdk资源不在根路径下时，需配置pluginPath</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-property">streamType</span>: <span class="cm-string">'video'</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">});</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 暂停/播放</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">const</span> <span class="cm-def">playOrSuspend</span> <span class="cm-operator">=</span> () <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-keyword">if</span> (<span class="cm-operator">!</span><span class="cm-variable">player</span>) <span class="cm-keyword">return</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-keyword">let</span> <span class="cm-def">isPlaying</span> <span class="cm-operator">=</span> <span class="cm-variable">player</span>.<span class="cm-property">isPlaying</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-keyword">if</span> (<span class="cm-operator">!</span><span class="cm-variable-2">isPlaying</span>) {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-keyword">if</span> (<span class="cm-variable">player</span>.<span class="cm-property">isInit</span>) {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-variable">player</span>.<span class="cm-property">start</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp;  } <span class="cm-keyword">else</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-variable">player</span>.<span class="cm-property">play</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp;  }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  } <span class="cm-keyword">else</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-variable">player</span>.<span class="cm-property">pause</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 538px;"></div><div class="CodeMirror-gutters" style="display: none; height: 538px;"></div></div></div></pre><h4><a name='header-n724' class='md-header-anchor '></a>4.4.2 回放</h4><h5><a name='header-n725' class='md-header-anchor '></a>4.4.2.1 示例 -- 回放</h5><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="js" style="break-inside: unset;"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 初始化</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">const</span> <span class="cm-def">TumsPlayer</span> <span class="cm-operator">=</span> <span class="cm-variable">window</span>[<span class="cm-string">'tums-player'</span>].<span class="cm-property">default</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span> <span class="cm-operator">=</span> <span class="cm-keyword">new</span> <span class="cm-variable">TumsPlayer</span>(<span class="cm-variable">document</span>.<span class="cm-property">querySelector</span>(<span class="cm-string">'#container'</span>), {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-property">type</span>: <span class="cm-string">'relay'</span>, <span class="cm-comment">// 协议类型</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-property">url</span>: <span class="cm-string">'https://xxxxx'</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-property">pluginPath</span>: <span class="cm-string">'/master'</span>, <span class="cm-comment">// 当sdk资源不在根路径下时，需配置pluginPath</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-property">streamType</span>: <span class="cm-string">'sdvod'</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-property">userId</span>: <span class="cm-number">55</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-property">scale</span>: <span class="cm-number">1</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-property">startTime</span>: <span class="cm-number">1705507200000</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-property">eventType</span>: [<span class="cm-number">1</span>, <span class="cm-number">2</span>]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">});</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 暂停/播放</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">const</span> <span class="cm-def">playOrSuspend</span> <span class="cm-operator">=</span> () <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-keyword">if</span> (<span class="cm-operator">!</span><span class="cm-variable">player</span>) <span class="cm-keyword">return</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-keyword">let</span> <span class="cm-def">isPlaying</span> <span class="cm-operator">=</span> <span class="cm-variable">player</span>.<span class="cm-property">isPlaying</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-keyword">if</span> (<span class="cm-operator">!</span><span class="cm-variable-2">isPlaying</span>) {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-keyword">if</span> (<span class="cm-variable">player</span>.<span class="cm-property">isInit</span>) {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-variable">player</span>.<span class="cm-property">start</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp;  } <span class="cm-keyword">else</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-variable">player</span>.<span class="cm-property">play</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp;  }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  } <span class="cm-keyword">else</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-variable">player</span>.<span class="cm-property">pause</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 修改回放配置</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">const</span> <span class="cm-def">setPlaybackConfig</span> <span class="cm-operator">=</span> () <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">player</span>.<span class="cm-property">setPlaybackConfig</span>({</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-property">startTim</span>: <span class="cm-variable">xxx</span>, <span class="cm-comment">// 回放开始时间设置</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-property">endTime</span>: <span class="cm-variable">xxx</span>, <span class="cm-comment">// 回放结束时间设置</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-property">scale</span>: <span class="cm-number">2</span>, <span class="cm-comment">// 回放倍率</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-property">eventType</span>: [<span class="cm-number">1</span>, <span class="cm-number">2</span>, <span class="cm-number">3</span>] <span class="cm-comment">// 回放事件类型</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  });</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 获取当前回放时间</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">const</span> <span class="cm-def">getPlaybackTime</span> <span class="cm-operator">=</span> () <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-keyword">let</span> <span class="cm-def">timeStamp</span> <span class="cm-operator">=</span> <span class="cm-variable">player</span>.<span class="cm-property">getPlaybackTime</span>(); <span class="cm-comment">// 13位时间戳</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 976px;"></div><div class="CodeMirror-gutters" style="display: none; height: 976px;"></div></div></div></pre><h4><a name='header-n727' class='md-header-anchor '></a>4.4.3 对讲</h4><h5><a name='header-n728' class='md-header-anchor '></a>4.4.3.1 示例 -- 开始对讲</h5><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="js"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span>.<span class="cm-property">startVoiceIntercom</span>({</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-property">url</span>: <span class="cm-string">'https://xxx/requestRelayUrl?token=xxx'</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">mode</span>: <span class="cm-string">'aec'</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">});</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 100px;"></div><div class="CodeMirror-gutters" style="display: none; height: 100px;"></div></div></div></pre><h5><a name='header-n730' class='md-header-anchor '></a>4.4.3.2 示例 -- 结束对讲</h5><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="js"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span>.<span class="cm-property">stopVoiceIntercom</span>();</span></pre></div></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 31px;"></div><div class="CodeMirror-gutters" style="display: none; height: 31px;"></div></div></div></pre><h4><a name='header-n732' class='md-header-anchor '></a>4.4.4 云台</h4><h5><a name='header-n733' class='md-header-anchor '></a>4.4.4.1 示例 -- 获取云台（ptz）能力集</h5><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="js"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// motor类型云台通过getMotorCapability方法获取云台能力集</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">let</span> <span class="cm-def">capability</span> <span class="cm-operator">=</span> {};</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">getDeviceType</span>()</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">then</span>((<span class="cm-def">res</span>) <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-variable">capability</span> <span class="cm-operator">=</span> <span class="cm-variable-2">res</span>.<span class="cm-property">result</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>})</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">catch</span>((<span class="cm-def">errData</span>) <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// 获取失败，具体错误见errData.error_code</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>});</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 245px;"></div><div class="CodeMirror-gutters" style="display: none; height: 245px;"></div></div></div></pre><h5><a name='header-n735' class='md-header-anchor '></a>4.4.4.2 示例 -- 设置云台转向和调焦</h5><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="js"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">setPtzParams</span>({ <span class="cm-property">direction</span>: <span class="cm-number">1</span>, <span class="cm-property">speed</span>: <span class="cm-number">4</span>})<span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// 向右转动</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">then</span>(() <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-variable">player</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">setPtzParams</span>({ <span class="cm-property">direction</span>: <span class="cm-number">0</span>, <span class="cm-property">speed</span>: <span class="cm-number">4</span>});<span class="cm-tab" role="presentation" cm-text="	">   </span><span class="cm-comment">//停止转动</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>});</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 151px;"></div><div class="CodeMirror-gutters" style="display: none; height: 151px;"></div></div></div></pre><h5><a name='header-n737' class='md-header-anchor '></a>4.4.4.3 示例 -- 获取预置点</h5><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="js"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">let</span> <span class="cm-def">presets</span> <span class="cm-operator">=</span> [];</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">getAllPresets</span>()</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">then</span>((<span class="cm-def">res</span>) <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-variable">presets</span> <span class="cm-operator">=</span> <span class="cm-variable-2">res</span>.<span class="cm-property">result</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>});</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 150px;"></div><div class="CodeMirror-gutters" style="display: none; height: 150px;"></div></div></div></pre><h5><a name='header-n739' class='md-header-anchor '></a>4.4.4.4 示例 -- 操作预置点</h5><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="js"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 增加预置点，如果不带presetId或指定presetId对应的预置点未设置，则增加一个预置点，设备自动保存此刻位置信息，override字段不生效，否则修改此预置点。</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">operatePreset</span>()</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">then</span>(() <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">//设置成功</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>})</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">catch</span>((<span class="cm-def">errData</span>) <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// 设置失败，具体错误见errData.error_code</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>});</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 222px;"></div><div class="CodeMirror-gutters" style="display: none; height: 222px;"></div></div></div></pre><h5><a name='header-n741' class='md-header-anchor '></a>4.4.4.5 示例 -- 运动到预置点</h5><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="js"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 运动到预置点，其中presetId传参为预置点id，可通过getAllPresets方法获取</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">executePreset</span>({ <span class="cm-property">presetId</span>: <span class="cm-string">'1'</span> })</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">then</span>(() <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">//操作成功</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>})</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">catch</span>((<span class="cm-def">errData</span>) <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// 操作失败，具体错误见errData.error_code</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>});</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 222px;"></div><div class="CodeMirror-gutters" style="display: none; height: 222px;"></div></div></div></pre><h5><a name='header-n743' class='md-header-anchor '></a>4.4.4.6 示例 -- 删除预置点</h5><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="js"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 删除预置点，其中presetId传参为预置点id，可通过getAllPresets方法获取</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">deletePreset</span>({ <span class="cm-property">presetId</span>: <span class="cm-string">'1'</span> })</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">then</span>(() <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">//删除成功</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>})</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">catch</span>((<span class="cm-def">errData</span>) <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// 删除失败，具体错误见errData.error_code</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>});</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 222px;"></div><div class="CodeMirror-gutters" style="display: none; height: 222px;"></div></div></div></pre><h5><a name='header-n745' class='md-header-anchor '></a>4.4.4.7 示例 -- 云台复位</h5><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="js"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 为避免操作失败，可先通过getPtzDeviceResetSupport方法查询设备是否支持云台复位</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">resetPtzDevicePosition</span>()</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">then</span>(() <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">//操作成功</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>})</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">catch</span>((<span class="cm-def">errData</span>) <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// 操作失败，具体错误见errData.error_code</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>});</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 222px;"></div><div class="CodeMirror-gutters" style="display: none; height: 222px;"></div></div></div></pre><h5><a name='header-n747' class='md-header-anchor '></a>4.4.4.8 示例 -- 获取巡航路径</h5><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="js" style="break-inside: unset;"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">let</span> <span class="cm-def">maxTourNumber</span> <span class="cm-operator">=</span> <span class="cm-number">0</span>;</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">let</span> <span class="cm-def">tourIds</span> <span class="cm-operator">=</span> [];</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">let</span> <span class="cm-def">tourNames</span> <span class="cm-operator">=</span> [];</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">let</span> <span class="cm-def">tourStates</span> <span class="cm-operator">=</span> [];</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">getAllTours</span>()</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">then</span>((<span class="cm-def">res</span>) <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-variable">maxTourNumber</span> <span class="cm-operator">=</span> <span class="cm-variable-2">res</span>.<span class="cm-property">result</span>.<span class="cm-property">maxTourNumber</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-variable">tourIds</span> <span class="cm-operator">=</span> <span class="cm-variable-2">res</span>.<span class="cm-property">result</span>.<span class="cm-property">tourIds</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-variable">tourNames</span> <span class="cm-operator">=</span> <span class="cm-variable-2">res</span>.<span class="cm-property">result</span>.<span class="cm-property">tourNames</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-variable">tourStates</span> <span class="cm-operator">=</span> <span class="cm-variable-2">res</span>.<span class="cm-property">result</span>.<span class="cm-property">tourStates</span>;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>})</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">catch</span>((<span class="cm-def">errData</span>) <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// 操作失败，具体错误见errData.error_code</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>});</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 363px;"></div><div class="CodeMirror-gutters" style="display: none; height: 363px;"></div></div></div></pre><h5><a name='header-n749' class='md-header-anchor '></a>4.4.4.9 示例 -- 操作巡航路径</h5><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="js"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 添加巡航路径</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">addCruisePath</span>({<span class="cm-property">tourId</span>: <span class="cm-string">'1'</span>})</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">then</span>(() <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// 添加成功</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>})</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">catch</span>((<span class="cm-def">errData</span>) <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// 添加失败，具体错误见errData.error_code</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>});</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 222px;"></div><div class="CodeMirror-gutters" style="display: none; height: 222px;"></div></div></div></pre><h5><a name='header-n751' class='md-header-anchor '></a>4.4.4.10 示例 -- 播放巡航路径</h5><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="js"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 开始巡航</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">executeTour</span>({<span class="cm-property">tourId</span>: <span class="cm-string">'1'</span>, <span class="cm-property">action</span>: <span class="cm-string">'1'</span>})</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">then</span>(() <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// 操作成功</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>})</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">catch</span>((<span class="cm-def">errData</span>) <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// 操作失败，具体错误见errData.error_code</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>});</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 222px;"></div><div class="CodeMirror-gutters" style="display: none; height: 222px;"></div></div></div></pre><h5><a name='header-n753' class='md-header-anchor '></a>4.4.4.11 示例 -- 删除巡航路径</h5><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="js"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// tourId为巡航路径id，可通过getAllTours方法获得</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">deleteTour</span>({<span class="cm-property">tourId</span>: <span class="cm-string">'1'</span>})</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">then</span>(() <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// 操作成功</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>})</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">catch</span>((<span class="cm-def">errData</span>) <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// 操作失败，具体错误见errData.error_code</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>});</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 222px;"></div><div class="CodeMirror-gutters" style="display: none; height: 222px;"></div></div></div></pre><h5><a name='header-n755' class='md-header-anchor '></a>4.4.4.12 示例 -- 守望</h5><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="js"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 开启守望，该例子中actionId传参为预置点的唯一标识符，可通过getAllPresets方法获取</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">startParkConfig</span>({ <span class="cm-property">enabled</span>: <span class="cm-string">'1'</span>, <span class="cm-property">parkTime</span>: <span class="cm-string">'15'</span>, <span class="cm-property">mode</span>: <span class="cm-string">'preset'</span>, <span class="cm-property">actionId</span>: <span class="cm-string">'1'</span>})</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">then</span>(() <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">//设置成功</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>})</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">catch</span>((<span class="cm-def">errData</span>) <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// 设置失败，具体错误见errData.error_code</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>});</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 222px;"></div><div class="CodeMirror-gutters" style="display: none; height: 222px;"></div></div></div></pre><h4><a name='header-n757' class='md-header-anchor '></a>4.4.5 设备控制</h4><h5><a name='header-n758' class='md-header-anchor '></a>4.4.5.1 示例 -- 镜头遮蔽</h5><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="js" style="break-inside: unset;"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 获取</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">getLensMaskValue</span>()</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">then</span>(({ <span class="cm-def">result</span> <span class="cm-operator">=</span> {} }) <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-variable-2">result</span>.<span class="cm-property">enabled</span>; <span class="cm-comment">// 遮蔽状态，true为遮蔽中，false为未遮蔽</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>});</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 设置（示例为开启遮蔽）</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">getImageSwitch</span>(<span class="cm-atom">true</span>)</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">then</span>(() <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// 设置成功，实际画面需要0.5-2s进行响应</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>})</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  .<span class="cm-property">catch</span>((<span class="cm-def">errData</span>) <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// 设置失败，包括网络错误以及接口调用报错</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// 具体错误见errData.error_code</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>});</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 410px;"></div><div class="CodeMirror-gutters" style="display: none; height: 410px;"></div></div></div></pre><h5><a name='header-n760' class='md-header-anchor '></a>4.4.5.2 示例 -- 画面镜像</h5><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="js" style="break-inside: unset;"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 获取</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">getImageSwitch</span>()</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">then</span>(({ <span class="cm-def">result</span> <span class="cm-operator">=</span> {} }) <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-variable-2">result</span>.<span class="cm-property">flip</span>; <span class="cm-comment">// 镜像状态，枚举值见方法说明</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-variable-2">result</span>.<span class="cm-property">rotate</span>; <span class="cm-comment">// 旋转状态，枚举值见方法说明</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>});</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 设置（示例为左右镜像）</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">saveImageSwitch</span>({ <span class="cm-property">flip_type：</span> <span class="cm-number">1</span> })</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">then</span>(() <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// 设置成功，实际画面需要0.5-2s进行响应</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>})</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  .<span class="cm-property">catch</span>((<span class="cm-def">errData</span>) <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// 设置失败，包括网络错误以及接口调用报错</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// 具体错误见errData.error_code</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>});</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 434px;"></div><div class="CodeMirror-gutters" style="display: none; height: 434px;"></div></div></div></pre><h5><a name='header-n762' class='md-header-anchor '></a>4.4.5.3 示例 -- 画面旋转</h5><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="js" style="break-inside: unset;"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 获取</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">getImageSwitch</span>()</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">then</span>(({ <span class="cm-def">result</span> <span class="cm-operator">=</span> {} }) <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-variable-2">result</span>.<span class="cm-property">flip</span>; <span class="cm-comment">// 镜像状态，枚举值见方法说明</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-variable-2">result</span>.<span class="cm-property">rotate</span>; <span class="cm-comment">// 旋转状态，枚举值见方法说明</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>});</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 设置（示例为顺时针旋转90）</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">saveImageSwitch</span>({ <span class="cm-property">rotate_type：</span> <span class="cm-number">1</span> })</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>.<span class="cm-property">then</span>(() <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// 设置成功，实际画面需要0.5-2s进行响应</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>})</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  .<span class="cm-property">catch</span>((<span class="cm-def">errData</span>) <span class="cm-operator">=&gt;</span> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  <span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// 设置失败，包括网络错误以及接口调用报错</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-comment">// 具体错误见errData.error_code</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span>});</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 434px;"></div><div class="CodeMirror-gutters" style="display: none; height: 434px;"></div></div></div></pre><h2><a name='header-n764' class='md-header-anchor '></a>5. 接入TP-LINK商用云平台指南</h2><p>用户需注册TP-LINK商用云平台账号成为开发者。</p><p>该账号需要安全保存，因为后续所有的开发流程都需要基于此账号进行，更重要的是，后续添加的设备与购买的服务，都归属于该账号。该账号还将作为超级管理员，可以创建子账号，从而实现应用内权限 的分配与管理：</p><ol start='' ><li>开通“开发者”平台服务（开发者菜单可在商云首页顶部菜单中找到）</li><li>选择所需套餐并创建自己所需要的应用</li><li>根据不同应用类型添加设备（项目型跟随项目添加即可，设备型需要在应用中单独添加）</li><li>开发者账号授权应用权限给子账户A</li><li>子账户A可以在 开发者 -&gt; 我的应用 -&gt; 应用管理 -&gt; 密钥信息中获取鉴权所需要的信息</li></ol><p>完成以上步骤后可通过相关协议文档获取到用于预览的视频流地址和鉴权token等信息。具体流程如下：</p><p>注：开放接口可以通过ak/sk的方式进行鉴权，具体使用说明可见商云“开发者”菜单。</p><h3><a name='header-n789' class='md-header-anchor '></a>5.1 预览流程</h3><div class="md-diagram-panel"><svg id="mermaidChart0" width="445.1875" xmlns="http://www.w3.org/2000/svg" height="425" viewBox="0 0 445.1875 425" style="height: auto; max-width: 100%;"><style></style><style>#mermaidChart0 {
    color: rgb(51, 51, 51);
    font: normal normal normal normal 14.4px / 23.04px Consolas, "Liberation Mono", Courier, monospace;
  }</style><g transform="translate(32, 32)"><g class="output"><g class="clusters"></g><g class="edgePaths"><g class="edgePath" style="opacity: 1;"><path class="path" d="M190.59375,63L190.59375,122.5L190.59375,182" marker-end="url(#arrowhead14)" style="fill:none"></path><defs><marker id="arrowhead14" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M190.59375,225L190.59375,261.5L190.59375,298" marker-end="url(#arrowhead15)" style="fill:none"></path><defs><marker id="arrowhead15" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker></defs></g></g><g class="edgeLabels"><g class="edgeLabel" transform="translate(190.59375,122.5)" style="opacity: 1;"><g transform="translate(-170.59375,-34.5)" class="label"><foreignObject width="341.1875" height="69"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">getDeviceListInProjectApplication（项目型） <br>或者<br> getDeviceListInDeviceApplication（设备型）</span></div></foreignObject></g></g><g class="edgeLabel" transform="translate(190.59375,261.5)" style="opacity: 1;"><g transform="translate(-63.34375,-11.5)" class="label"><foreignObject width="126.6875" height="23"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">requestStreamUrl</span></div></foreignObject></g></g></g><g class="nodes"><g class="node" id="a" transform="translate(190.59375,41.5)" style="opacity: 1;"><rect rx="0" ry="0" x="-53.203125" y="-21.5" width="106.40625" height="43"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-43.203125,-11.5)"><foreignObject width="86.40625" height="23"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">获取设备列表</div></foreignObject></g></g></g><g class="node" id="b" transform="translate(190.59375,203.5)" style="opacity: 1;"><rect rx="0" ry="0" x="-50.6796875" y="-21.5" width="101.359375" height="43"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-40.6796875,-11.5)"><foreignObject width="81.359375" height="23"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">获取预览url</div></foreignObject></g></g></g><g class="node" id="c" transform="translate(190.59375,319.5)" style="opacity: 1;"><rect rx="0" ry="0" x="-91.3515625" y="-21.5" width="182.703125" height="43"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-81.3515625,-11.5)"><foreignObject width="162.703125" height="23"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">预览url传给sdk即可播放</div></foreignObject></g></g></g></g></g></g></svg></div><p>requestStreamUrl请求和响应参数示例：</p><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="json"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-string cm-property">"qrCode"</span>:<span class="cm-string">"7D98AEE1EAF46E2E6"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-string cm-property">"channelId"</span>:<span class="cm-number">1</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-string cm-property">"streamType"</span>:<span class="cm-string">"video"</span>,<span class="cm-comment">// video: 预览，sdvod：回放</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-string cm-property">"resolution"</span>:<span class="cm-number">2</span>, <span class="cm-comment">// 0：流畅，2：高清</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-string cm-property">"clientType"</span>:<span class="cm-string">"browser"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-string cm-property">"result"</span>: {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"sdkStreamUrl"</span>: <span class="cm-string">"https://smbcloud-openapi.tp-link.com.cn/vms/open/webServer/v1/requestRelayUrl?token=12089-e2FwcGxpY2F0aW9uSWQgPSAxODYwfQ-9428ea08997541178fe11e3b6f4eec28&amp;devInfoId=21000002447&amp;clientType=browser&amp;streamType=video&amp;resolution=2"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  },</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-string cm-property">"error_code"</span>: <span class="cm-number">0</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 330px;"></div><div class="CodeMirror-gutters" style="display: none; height: 330px;"></div></div></div></pre><blockquote><p>预览时清晰度默认为流畅，若要修改清晰度，需重新调用requestStreamUrl接口配置resolution，以获取新的播放地址</p></blockquote><p>&nbsp;</p><h3><a name='header-n799' class='md-header-anchor '></a>5.2 回放流程</h3><p>获取设备前的流程与预览一致，前端拿到设备信息（parentQrCode、qrCode、channelId）之后，可查询设备存储的录像并进行播放：</p><div class="md-diagram-panel"><svg id="mermaidChart1" width="445.1875" xmlns="http://www.w3.org/2000/svg" height="1145.9874877929688" viewBox="0 0 445.1875 1145.9874877929688" style="height: auto; max-width: 100%;"><style></style><style>#mermaidChart1 {
    color: rgb(51, 51, 51);
    font: normal normal normal normal 14.4px / 23.04px Consolas, "Liberation Mono", Courier, monospace;
  }</style><g transform="translate(32, 32)"><g class="output"><g class="clusters"></g><g class="edgePaths"><g class="edgePath" style="opacity: 1;"><path class="path" d="M190.59375,63L190.59375,122.5L190.59375,182" marker-end="url(#arrowhead55)" style="fill:none"></path><defs><marker id="arrowhead55" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M190.59375,225L190.59375,261.5L190.59375,298" marker-end="url(#arrowhead56)" style="fill:none"></path><defs><marker id="arrowhead56" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M168.00629714439654,341L129.66015625,377.5L153.08928936139043,452.50446674212503" marker-end="url(#arrowhead57)" style="fill:none"></path><defs><marker id="arrowhead57" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M229.0982135113008,452.5044574077851L251.52734375,377.5L213.18120285560346,341" marker-end="url(#arrowhead58)" style="fill:none"></path><defs><marker id="arrowhead58" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M191.09375,737.4874938964844L190.59375,773.4874877929688L190.59375,809.9874877929688" marker-end="url(#arrowhead59)" style="fill:none"></path><defs><marker id="arrowhead59" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M190.59375,852.9874877929688L190.59375,877.9874877929688L190.59375,902.9874877929688" marker-end="url(#arrowhead60)" style="fill:none"></path><defs><marker id="arrowhead60" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M190.59375,945.9874877929688L190.59375,982.4874877929688L190.59375,1018.9874877929688" marker-end="url(#arrowhead61)" style="fill:none"></path><defs><marker id="arrowhead61" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker></defs></g></g><g class="edgeLabels"><g class="edgeLabel" transform="translate(190.59375,122.5)" style="opacity: 1;"><g transform="translate(-170.59375,-34.5)" class="label"><foreignObject width="341.1875" height="69"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">getDeviceListInProjectApplication（项目型） <br>或者<br> getDeviceListInDeviceApplication（设备型）</span></div></foreignObject></g></g><g class="edgeLabel" transform="translate(190.59375,261.5)" style="opacity: 1;"><g transform="translate(-39.5859375,-11.5)" class="label"><foreignObject width="79.171875" height="23"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">searchYear</span></div></foreignObject></g></g><g class="edgeLabel" transform="translate(129.66015625,377.5)" style="opacity: 1;"><g transform="translate(-43.546875,-11.5)" class="label"><foreignObject width="87.09375" height="23"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">searchVideo</span></div></foreignObject></g></g><g class="edgeLabel" transform="translate(251.52734375,377.5)" style="opacity: 1;"><g transform="translate(-58.3203125,-11.5)" class="label"><foreignObject width="116.640625" height="23"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">是, 继续查询录像</span></div></foreignObject></g></g><g class="edgeLabel" transform="translate(190.59375,773.4874877929688)" style="opacity: 1;"><g transform="translate(-43.921875,-11.5)" class="label"><foreignObject width="87.84375" height="23"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">否, 查询完成</span></div></foreignObject></g></g><g class="edgeLabel" transform="" style="opacity: 1;"><g transform="translate(0,0)" class="label"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel" transform="translate(190.59375,982.4874877929688)" style="opacity: 1;"><g transform="translate(-63.34375,-11.5)" class="label"><foreignObject width="126.6875" height="23"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">requestStreamUrl</span></div></foreignObject></g></g></g><g class="nodes"><g class="node" id="a" transform="translate(190.59375,41.5)" style="opacity: 1;"><rect rx="0" ry="0" x="-53.203125" y="-21.5" width="106.40625" height="43"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-43.203125,-11.5)"><foreignObject width="86.40625" height="23"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">获取设备列表</div></foreignObject></g></g></g><g class="node" id="b" transform="translate(190.59375,203.5)" style="opacity: 1;"><rect rx="0" ry="0" x="-118" y="-21.5" width="236" height="43"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-108,-11.5)"><foreignObject width="216" height="23"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">查询设备具有录像的日期（可选）</div></foreignObject></g></g></g><g class="node" id="c" transform="translate(190.59375,319.5)" style="opacity: 1;"><rect rx="0" ry="0" x="-118" y="-21.5" width="236" height="43"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-108,-11.5)"><foreignObject width="216" height="23"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">查询设备在某天所存储的录像片段</div></foreignObject></g></g></g><g class="node" id="d" transform="translate(190.59375,575.4937438964844)" style="opacity: 1;"><polygon points="161.49375,0 322.9875,-161.49375 161.49375,-322.9875 0,-161.49375" rx="5" ry="5" transform="translate(-161.49375,161.49375)"></polygon><g class="label" transform="translate(0,0)"><g transform="translate(-147.9375,-11.5)"><foreignObject width="295.875" height="23"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">响应的录像片段长度 == endIdx - startIdx</div></foreignObject></g></g></g><g class="node" id="e" transform="translate(190.59375,831.4874877929688)" style="opacity: 1;"><rect rx="0" ry="0" x="-106.46875" y="-21.5" width="212.9375" height="43"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-96.46875,-11.5)"><foreignObject width="192.9375" height="23"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">记录userId, 显示录像时间轴</div></foreignObject></g></g></g><g class="node" id="f" transform="translate(190.59375,924.4874877929688)" style="opacity: 1;"><rect rx="0" ry="0" x="-53.203125" y="-21.5" width="106.40625" height="43"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-43.203125,-11.5)"><foreignObject width="86.40625" height="23"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">获取回放地址</div></foreignObject></g></g></g><g class="node" id="g" transform="translate(190.59375,1040.4874877929688)" style="opacity: 1;"><rect rx="0" ry="0" x="-91.3515625" y="-21.5" width="182.703125" height="43"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-81.3515625,-11.5)"><foreignObject width="162.703125" height="23"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">回放url传给sdk即可播放</div></foreignObject></g></g></g></g></g></g></svg></div><p>回放时sdk传参必填项如下：</p><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="javascript"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">var</span> <span class="cm-def">player</span> <span class="cm-operator">=</span> <span class="cm-keyword">new</span> <span class="cm-variable">TumsPlayer</span>(<span class="cm-string">'video-container'</span>, {</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-property">type</span>: <span class="cm-string">'relay'</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text="	">    </span><span class="cm-property">url</span>: <span class="cm-string">'https://xxx/requestRelayUrl?token=xxx&amp;&amp;streamType=sdvod'</span> <span class="cm-comment">// 取流地址</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">streamType</span>: <span class="cm-string">'sdvod'</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-variable">userId</span>: <span class="cm-string">'1'</span>, <span class="cm-comment">// searchVideo接口获取</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">});</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 148px;"></div><div class="CodeMirror-gutters" style="display: none; height: 148px;"></div></div></div></pre><p>回放常用功能示例：</p><pre spellcheck="false" class="md-fences md-end-block contain-cm modeLoaded" lang="javascript"><div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span>.<span class="cm-property">getPlaybackTime</span>(); <span class="cm-comment">// 获取回放进度，更新时间轴可使用此方法</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span>.<span class="cm-property">setPlaybackConfig</span>({</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-property">startTime</span>: <span class="cm-variable">xxxx</span> <span class="cm-comment">// 跳转到指定时间开始回放</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">});</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">player</span>.<span class="cm-property">setPlaybackConfig</span>({</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-property">startTime</span>: <span class="cm-variable">xxxx</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-property">scale</span>: <span class="cm-number">0.5</span> <span class="cm-comment">// 配置可组合，跳转时间并开启1/2倍速播放</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">});</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 192px;"></div><div class="CodeMirror-gutters" style="display: none; height: 192px;"></div></div></div></pre><h2><a name='header-n809' class='md-header-anchor '></a>6. 附录</h2><h3><a name='header-n810' class='md-header-anchor '></a>6.1 错误码</h3><figure><table><thead><tr><th>code</th><th>含义</th><th>问题定位</th></tr></thead><tbody><tr><td>1001</td><td>请求中止</td><td>一般为传参问题或设备异常</td></tr><tr><td>1002</td><td>网络异常</td><td>&nbsp;</td></tr><tr><td>1003</td><td>媒体资源解析错误</td><td>&nbsp;</td></tr><tr><td>1004</td><td>不支持的媒体源</td><td>&nbsp;</td></tr><tr><td>1005</td><td>媒体资源已加密</td><td>&nbsp;</td></tr><tr><td>1006</td><td>媒体数据传输错误</td><td>&nbsp;</td></tr><tr><td>1007</td><td>连接服务器失败</td><td>&nbsp;</td></tr><tr><td>1008</td><td>不支持的解码类型</td><td>&nbsp;</td></tr><tr><td>1101</td><td>商云服务器内部错误</td><td>&nbsp;</td></tr><tr><td>1102</td><td>token过期或不存在</td><td>&nbsp;</td></tr><tr><td>1104</td><td>设备ID无效</td><td>&nbsp;</td></tr><tr><td>1105</td><td>达到带宽限制</td><td>在线观看人数过多，需要在商云中开放持续播放专用通道服务</td></tr><tr><td>1106</td><td>请求预览地址参数错误</td><td>&nbsp;</td></tr><tr><td>1107</td><td>连接relay服务器失败</td><td>&nbsp;</td></tr><tr><td>1108</td><td>取流失败</td><td>&nbsp;</td></tr><tr><td>1109</td><td>暂不支持此视频流协议版本</td><td>&nbsp;</td></tr><tr><td>1110</td><td>已达到拉流请求上限</td><td>&nbsp;</td></tr><tr><td>1111</td><td>已长时间观看</td><td>&nbsp;</td></tr><tr><td>1112</td><td>VIP窗口预览数达到上限</td><td>&nbsp;</td></tr><tr><td>1113</td><td>VIP预览客户端数量达到上限</td><td>&nbsp;</td></tr><tr><td>1114</td><td>分享时段结束</td><td>&nbsp;</td></tr><tr><td>1115</td><td>权限不足</td><td>&nbsp;</td></tr><tr><td>1120</td><td>多媒体数据加密状态发生变化</td><td>&nbsp;</td></tr><tr><td>1121</td><td>设备正在通话中</td><td>&nbsp;</td></tr><tr><td>1122</td><td>解绑设备</td><td>&nbsp;</td></tr><tr><td>1201</td><td>设备不支持语音对讲</td><td>&nbsp;</td></tr><tr><td>1202</td><td>用户拒绝提供信息</td><td>&nbsp;</td></tr><tr><td>1203</td><td>浏览器不支持硬件设备</td><td>&nbsp;</td></tr><tr><td>1204</td><td>无法发现指定的硬件设备</td><td>&nbsp;</td></tr><tr><td>1205</td><td>无法打开麦克风</td><td>请检测是否有接入音频输入设备，或者浏览器的麦克风权限是否打开</td></tr><tr><td>1206</td><td>通话模式不支持</td><td>&nbsp;</td></tr><tr><td>1207</td><td>音频设备正忙，无法发起通话</td><td>&nbsp;</td></tr><tr><td>1208</td><td>浏览器获取麦克风权限被拒绝</td><td>&nbsp;</td></tr><tr><td>1301</td><td>设备离线</td><td>请检测商云中该设备的状态</td></tr><tr><td>1302</td><td>设备被移除</td><td>&nbsp;</td></tr><tr><td>1303</td><td>设备密码被修改</td><td>&nbsp;</td></tr><tr><td>1401</td><td>未知错误</td><td>请保留设备相关信息，所属项目及分组，并联系技术支持处理</td></tr><tr><td>1402</td><td>操作超时</td><td>&nbsp;</td></tr><tr><td>1403</td><td>网络异常</td><td>&nbsp;</td></tr><tr><td>1404</td><td>服务器内部错误</td><td>&nbsp;</td></tr><tr><td>1405</td><td>session过期或不存在</td><td>&nbsp;</td></tr><tr><td>1501</td><td>回放配置失败</td><td>&nbsp;</td></tr><tr><td>2001</td><td>分辨率过高导致视频卡顿</td><td>帧率过低提示（可能设备配置的帧率本身就低）</td></tr><tr><td>2002</td><td>网络不稳定导致视频卡顿</td><td>帧率过低提示（可能设备配置的帧率本身就低）</td></tr><tr><td>2003</td><td>解码性能不足</td><td>解码过慢，可能是浏览器资源不足够解码器流畅运行</td></tr></tbody></table></figure><h3><a name='header-n996' class='md-header-anchor '></a>6.2 事件类型约束</h3><figure><table><thead><tr><th>eventType</th><th><strong>事件类型</strong></th><th>eventType</th><th><strong>事件类型</strong></th></tr></thead><tbody><tr><td>1</td><td>定时</td><td>2</td><td>移动侦测</td></tr><tr><td>3</td><td>遮挡侦测</td><td>4</td><td>越界侦测</td></tr><tr><td>5</td><td>区域入侵</td><td>6</td><td>进入区域</td></tr><tr><td>7</td><td>离开区域</td><td>8</td><td>徘徊侦测</td></tr><tr><td>9</td><td>人员聚集</td><td>10</td><td>快速移动</td></tr><tr><td>11</td><td>停车侦测</td><td>12</td><td>物品遗留</td></tr><tr><td>13</td><td>物品拿取</td><td>14</td><td>音频异常</td></tr><tr><td>15</td><td>虚焦侦测</td><td>16</td><td>场景变更</td></tr><tr><td>17</td><td>人脸侦测</td><td>18</td><td>报警</td></tr><tr><td>19</td><td>过线统计</td><td>20</td><td>登陆异常</td></tr><tr><td>21</td><td>SD卡满</td><td>22</td><td>SD卡错误</td></tr><tr><td>23</td><td>SD卡拔出</td><td>24</td><td>网线断开</td></tr><tr><td>25</td><td>IP冲突</td><td>26</td><td>人形检测</td></tr><tr><td>27</td><td>车辆侦测</td><td>28</td><td>物品遗漏拿取侦测</td></tr><tr><td>29</td><td>移动侦测云存</td><td>30</td><td>迎宾播报</td></tr><tr><td>31</td><td>视频留言</td><td>32</td><td>移动侦测人形加强</td></tr><tr><td>33</td><td>移动侦测车辆加强</td><td>34</td><td>区域入侵人形加强</td></tr><tr><td>35</td><td>区域入侵车辆加强</td><td>36</td><td>越界侦测人形加强</td></tr><tr><td>37</td><td>越界侦测车辆加强</td><td>38</td><td>人脸比对</td></tr><tr><td>39</td><td>人脸相册</td><td>40</td><td>进入区域人形加强</td></tr><tr><td>41</td><td>进入区域车辆加强</td><td>42</td><td>离开区域人形加强</td></tr><tr><td>43</td><td>离开区域车辆加强</td><td>44</td><td>客流量统计</td></tr><tr><td>45</td><td>门铃呼叫</td><td>46</td><td>人员到访</td></tr><tr><td>47</td><td>车位占用</td><td>48</td><td>哭声检测</td></tr><tr><td>49</td><td>人形相册</td><td>50</td><td>紧急呼救</td></tr></tbody></table></figure><h3><a name='header-n1128' class='md-header-anchor '></a>6.3 云台能力集</h3><h4><a name='header-n1129' class='md-header-anchor '></a>6.3.1 Ptz</h4><figure><table><thead><tr><th style='text-align:left;' >序号</th><th style='text-align:left;' >能力集字段</th><th style='text-align:left;' >能力集字段说明</th></tr></thead><tbody><tr><td style='text-align:left;' >1</td><td style='text-align:left;' >position_pan_range<br>array<string></td><td style='text-align:left;' >支持的水平方向移动范围。浮点型字符串数组，数组长度2，每个浮点数取值范围 -1 - 1。为[&quot;0.000000&quot;, &quot;0.000000&quot;]时，表示不支持水平方向移动。当position_pan_range和position_tilt_range都设置为[&quot;0.000000&quot;, &quot;0.000000&quot;]时，表示不支持云台功能。</td></tr><tr><td style='text-align:left;' >2</td><td style='text-align:left;' >position_tilt_range <br>array<string></td><td style='text-align:left;' >支持的垂直方向移动范围。浮点型字符串数组，数组长度2，每个浮点数取值范围 -1 - 1。为[&quot;0.000000&quot;, &quot;0.000000&quot;]时，表示不支持垂直方向移动。当position_pan_range和position_tilt_range都设置为[&quot;0.000000&quot;, &quot;0.000000&quot;]时，表示不支持云台功能。</td></tr><tr><td style='text-align:left;' >3</td><td style='text-align:left;' >position_zoom_range <br>array<string></td><td style='text-align:left;' >支持的缩放倍数范围。可选。浮点型字符串数组，数组长度2，每个浮点数取值范围 0 - 1。<br>缺少该字段：不支持变焦功能。</td></tr><tr><td style='text-align:left;' >4</td><td style='text-align:left;' >speed_pan_max<br>string</td><td style='text-align:left;' >支持的水平移动速度最大值。浮点型字符串，取值范围0 - 1。</td></tr><tr><td style='text-align:left;' >5</td><td style='text-align:left;' >speed_tilt_max<br>string</td><td style='text-align:left;' >支持的垂直移动速度最大值。浮点型字符串，取值范围0 - 1。</td></tr><tr><td style='text-align:left;' >6</td><td style='text-align:left;' >speed_zoom_max <br>string</td><td style='text-align:left;' >支持的缩放速度最大值。浮点型字符串，取值范围0 - 1。无 position_zoom_range字段时无该字段。</td></tr><tr><td style='text-align:left;' >7</td><td style='text-align:left;' >eflip_mode <br>array<string></td><td style='text-align:left;' >垂直翻转模式，具体指云台电机的垂直翻转。<br>字符串数组，取值范围：<br>缺少该字段：不支持垂直翻转功能；<br>off：垂直翻转功能关闭；<br>on：垂直翻转功能开启</td></tr><tr><td style='text-align:left;' >8</td><td style='text-align:left;' >reverse_mode<br>array<string></td><td style='text-align:left;' >中心反转，具体指云台电机的中心反转<br>字符串数组，取值范围：<br>缺少该字段：不支持中心反转功能；<br>off：中心反转功能关闭；<br>on：中心反转功能开启<br>auto：自动</td></tr><tr><td style='text-align:left;' >9</td><td style='text-align:left;' >home_position_mode <br>string</td><td style='text-align:left;' >是否支持原点功能。<br>字符串数组，取值范围：<br>none：不支持所有与原点功能相关的操作<br>fixed：原点固定，不可修改<br>configurable：原点可配置</td></tr><tr><td style='text-align:left;' >10</td><td style='text-align:left;' >absolute_move_supported<br>string</td><td style='text-align:left;' >是否支持绝对移动。<br>取值范围：<br>缺少该字段或为0：不支持<br>1：支持</td></tr><tr><td style='text-align:left;' >11</td><td style='text-align:left;' >relative_move_supported<br>string</td><td style='text-align:left;' >是否支持相对移动。<br>取值范围：<br>缺少该字段或为0：不支持<br>1：支持</td></tr><tr><td style='text-align:left;' >12</td><td style='text-align:left;' >continuous_move_supported <br>string</td><td style='text-align:left;' >是否支持连续移动。<br>取值范围：<br>缺少该字段或为0：不支持<br>1：支持</td></tr><tr><td style='text-align:left;' >13</td><td style='text-align:left;' >scan_supported <br>string</td><td style='text-align:left;' >是否支持扫描。<br>取值范围：<br>缺少该字段或为0：不支持<br>1：支持</td></tr><tr><td style='text-align:left;' >14</td><td style='text-align:left;' >scan_support_type_list <br>array<string></td><td style='text-align:left;' >扫描支持类型列表，需与scan_supported配合使用，如果scan_supported不支持则无该字段。<br>字符串数组，取值范围可包括：<br>auto_scan: 自动扫描；<br>frame_scan: 帧扫描；<br>random_scan: 随机扫描；<br>panorama_scan: 全景扫描；<br>tilt_scan: 垂直扫描。</td></tr><tr><td style='text-align:left;' >15</td><td style='text-align:left;' >preset_supported <br>string</td><td style='text-align:left;' >是否支持预置点相关操作。<br>取值范围：<br>缺少该字段或为0：不支持<br>1：支持</td></tr><tr><td style='text-align:left;' >16</td><td style='text-align:left;' >preset_number_max <br>string</td><td style='text-align:left;' >最大支持的预置点个数，需与preset_supported配合使用，如果preset_supported不支持则无该字段。</td></tr><tr><td style='text-align:left;' >17</td><td style='text-align:left;' >tour_supported <br>string</td><td style='text-align:left;' >是否支持巡航功能。<br>取值范围：<br>缺少该字段或为0：不支持<br>1：支持</td></tr><tr><td style='text-align:left;' >18</td><td style='text-align:left;' >tour_number_max <br>string</td><td style='text-align:left;' >最大支持的巡航路径个数，需与tour_supported配合使用，如果tour_supported不支持则无该字段。</td></tr><tr><td style='text-align:left;' >19</td><td style='text-align:left;' >tour_spots_number_max <br>string</td><td style='text-align:left;' >每条巡航最大支持的巡航点数量，需与tour_supported配合使用，该数量不能大于preset_number_max。</td></tr><tr><td style='text-align:left;' >20</td><td style='text-align:left;' >tour_recurring_times_range <br>array<string></td><td style='text-align:left;' >支持的巡航次数范围，数字字符串数组，数组长度为2。只有当tour_supported为1时才有该项。<br>可选。</td></tr><tr><td style='text-align:left;' >21</td><td style='text-align:left;' >tour_recurring_duration_range <br>array<string></td><td style='text-align:left;' >支持的巡航时间，数字字符串数组，数组长度为2。只有当tour_supported为1时才有该项。<br>单位为毫秒，可选。</td></tr><tr><td style='text-align:left;' >22</td><td style='text-align:left;' >tour_stay_time_range <br>array<string></td><td style='text-align:left;' >巡航点停留的时间，数字字符串数组，数组长度为2。只有当tour_supported为1时才有该项。<br>单位为毫秒。</td></tr><tr><td style='text-align:left;' >23</td><td style='text-align:left;' >pattern_supported <br>string</td><td style='text-align:left;' >是否支持花样扫描功能。<br>取值范围：<br>缺少该字段或为0：不支持<br>1：支持</td></tr><tr><td style='text-align:left;' >24</td><td style='text-align:left;' >pattern_number_max <br>string</td><td style='text-align:left;' >最大支持的花样扫描路径个数，需与pattern_supported配合使用，如果pattern_supported不支持则无该字段。</td></tr><tr><td style='text-align:left;' >25</td><td style='text-align:left;' >pattern_spots_number_max <br>string</td><td style='text-align:left;' >每条花样扫描路径最大支持的操作数量，需与pattern_supported配合使用，如果pattern_supported不支持则无该字段。</td></tr><tr><td style='text-align:left;' >26</td><td style='text-align:left;' >park_supported <br>string</td><td style='text-align:left;' >是否支持守望功能。该字段为1时，ptz支持park_config配置。<br>取值范围：<br>缺少该字段或为0：不支持<br>1：支持</td></tr><tr><td style='text-align:left;' >27</td><td style='text-align:left;' >park_support_mode_list <br>array<string></td><td style='text-align:left;' >守望操作类型列表。需根据样机实际支持的操作来设置。<br>字符串数组，取值范围可包括：<br>auto_scan: 自动扫描；<br>frame_scan: 帧扫描；<br>random_scan: 随机扫描；<br>tour: 巡航扫描；<br>preset: 预置点；<br>pattern: 花样扫描；<br>panorama_scan: 全景扫描；<br>tilt_scan: 垂直扫描。<br>其中auto_scan, frame_scan, random_scan, panorama_scan和tilt_scan需根据scan_support_type_list是否支持来设置。</td></tr><tr><td style='text-align:left;' >28</td><td style='text-align:left;' >park_time_range <br>array<string></td><td style='text-align:left;' >支持的守望时间范围，数字字符串数组，数组长度为2。只有当park_supported为1时才有该项。<br>单位为秒，可选。</td></tr><tr><td style='text-align:left;' >29</td><td style='text-align:left;' >plan_supported <br>string</td><td style='text-align:left;' >是否支持定时任务功能。<br>取值范围：<br>缺少该字段或为0：不支持<br>1：支持</td></tr><tr><td style='text-align:left;' >30</td><td style='text-align:left;' >plan_support_type_list <br>array<string></td><td style='text-align:left;' >定时任务操作类型，需根据样机实际支持的操作来设置；需与plan_supported配合使用，如果plan_supported不支持则无该字段。<br>字符串数组，取值范围可包括：<br>auto_scan: 自动扫描；<br>frame_scan: 帧扫描；<br>random_scan: 随机扫描；<br>tour: 巡航扫描；<br>preset: 预置点；<br>pattern: 花样扫描；<br>panorama_scan: 全景扫描；<br>tilt_scan: 垂直扫描；<br>reboot: 球机重启；<br>adjust: 球机自检；<br>auxoutput: 辅助输出；<br>disable: 关闭，表示这该段时间定时任务不生效。<br>其中auto_scan, frame_scan, random_scan, panorama_scan和tilt_scan需根据scan_support_type_list是否支持来设置。</td></tr><tr><td style='text-align:left;' >31</td><td style='text-align:left;' >plan_resume_time_range <br>array<string></td><td style='text-align:left;' >支持的定时任务恢复时间范围，数字字符串数组，数组长度为2。只有当plan_supported为1时才有该项。<br>单位为秒，可选。</td></tr><tr><td style='text-align:left;' >32</td><td style='text-align:left;' >plan_number_of_oneday_max <br>string</td><td style='text-align:left;' >支持的一天最大定时任务数，只有当plan_supported为1时才有该项。可选。</td></tr><tr><td style='text-align:left;' >33</td><td style='text-align:left;' >poweroff_save_supported <br>string</td><td style='text-align:left;' >是否支持断电记忆功能。<br>取值范围：<br>缺少该字段或为0：不支持<br>1：支持</td></tr><tr><td style='text-align:left;' >34</td><td style='text-align:left;' >poweroff_save_time_range <br>array<string></td><td style='text-align:left;' >断电记忆的时间范围，数字字符串数组，数组长度为2。 只有当poweroff_save_supported为1时才有该项。<br>单位为秒，可选。</td></tr><tr><td style='text-align:left;' >35</td><td style='text-align:left;' >elevation_angle_max <br>string</td><td style='text-align:left;' >支持的垂直最大仰角范围。<br>单位为度，可选。<br>缺少该字段或为0：不支持仰角。</td></tr><tr><td style='text-align:left;' >36</td><td style='text-align:left;' >limit_supported <br>string</td><td style='text-align:left;' >是否支持限位功能。<br>取值范围：<br>缺少该字段或为0：不支持<br>1：支持</td></tr><tr><td style='text-align:left;' >37</td><td style='text-align:left;' >calibrate_supported <br>string</td><td style='text-align:left;' >是否支持手动校准功能。<br>取值范围：<br>缺少该字段或为0：不支持<br>1：支持</td></tr><tr><td style='text-align:left;' >38</td><td style='text-align:left;' >scan_tour_supported <br>string</td><td style='text-align:left;' >是否支持扫描巡航功能。<br>取值范围：<br>缺少该字段或为0：不支持<br>1：支持</td></tr><tr><td style='text-align:left;' >39</td><td style='text-align:left;' >multipoint_tour_supported <br>string</td><td style='text-align:left;' >是否支持多点巡航功能。多点巡航依赖定时任务，若定时任务不支持，则多点巡航也不支持。<br>取值范围：<br>缺少该字段或为0：不支持<br>1：支持</td></tr><tr><td style='text-align:left;' >40</td><td style='text-align:left;' >panorama_supported <br>string</td><td style='text-align:left;' >是否支持生成全景图功能。<br>取值范围：<br>缺少该字段或为0：不支持<br>1：支持</td></tr><tr><td style='text-align:left;' >41</td><td style='text-align:left;' >picture_number <br>string</td><td style='text-align:left;' >表示用于生成全景图总的图片数量。<br>panorama_supported为1时才有该字段。</td></tr><tr><td style='text-align:left;' >42</td><td style='text-align:left;' >overlap_width_percent <br>string</td><td style='text-align:left;' >表示生成全景图时图片重合宽度比例，浮点型字符串，取值范围0 - 100。panorama_supported为1时才有该字段。</td></tr><tr><td style='text-align:left;' >43</td><td style='text-align:left;' >panorama_x_coord_start <br>string</td><td style='text-align:left;' >表示生成全景图起始时的水平电机位置，单位为度(整数)。panorama_supported为1时才有该字段。</td></tr><tr><td style='text-align:left;' >44</td><td style='text-align:left;' >panorama_x_coord_end <br>string</td><td style='text-align:left;' >表示生成全景图结束时的水平电机位置，单位为度(整数)。panorama_supported为1时才有该字段。</td></tr><tr><td style='text-align:left;' >45</td><td style='text-align:left;' >distortion_correction_k1 <br>string</td><td style='text-align:left;' >表示生成全景图结束时的镜头畸变矫正参数k1。浮点型字符串，取值范围0 - 100。panorama_supported为1时才有该字段。</td></tr><tr><td style='text-align:left;' >46</td><td style='text-align:left;' >distortion_correction_k2 <br>string</td><td style='text-align:left;' >表示生成全景图结束时的镜头畸变矫正参数k2。浮点型字符串，取值范围0 - 100。panorama_supported为1时才有该字段。</td></tr><tr><td style='text-align:left;' >47</td><td style='text-align:left;' >zoom_multiple_range <br>array<string></td><td style='text-align:left;' >倍数切换功能支持的倍数最小值和最大值。可选。<br>缺少该字段：不支持倍数切换功能。<br>取值范围：[x, y]<br>浮点型字符串数组，数组仅包含两个元素，x表示最小倍数，y表示最大倍数，数值精确到小数点后1位。<br>无position_zoom_range字段时无该字段。</td></tr><tr><td style='text-align:left;' >48</td><td style='text-align:left;' >extend_zoom_method <br>array<string></td><td style='text-align:left;' >是否支持更多的变焦方式，当position_zoom_range存在并有效时，该字段才有效。<br>若该字段不存在或者该字段值为空，不支持更多的变焦方式。<br>若该字段存在且值不为空，代表支持更多的变焦方式，目前有如下方式：<br>取值范围：<br>smooth：该变焦方式下，调用者可以控制设备变焦到用户指定的倍率。若存在zoom_multiple_range时，该选项才有效。<br>direct：该变焦方式下，调用者可以控制设备直接跳变到用户指定的倍率。若存在zoom_multiple_range时，该选项才有效。与smooth的区别是，该变焦方式下，没有中间的连续变化的变焦过程。</td></tr><tr><td style='text-align:left;' >49</td><td style='text-align:left;' >beyond_move_range <br>array<string></td><td style='text-align:left;' >支持的超过软件限位的转动范围。软件限位由position_pan_range与position_tilt_range字段共同决定取较大范围值。<br>浮点型字符串数组，数组长度2，每个浮点数取值范围 -4 - 4。设置为[0.000000,0.000000]时，表示不支持超过软件限位转动。</td></tr><tr><td style='text-align:left;' >50</td><td style='text-align:left;' >position3D_unsupported <br>string</td><td style='text-align:left;' >该字段表示ptz模块是否不支持3D定位和镜头居中功能。position3D_unsupported字段取值范围：<br>- 缺少该字段或取值为0：支持镜头居中服务功能；<br>- 该字段存在且取值为1：不支持镜头居中服务功能；</td></tr><tr><td style='text-align:left;' >51</td><td style='text-align:left;' >pan_tilt_rotate_sync_unsupported <br>string</td><td style='text-align:left;' >该字段表示/ptz模块是否不支持水平垂直电机同时转动。此字段只在水平电机(position_pan_range字段存在且不为[0.000000,0.000000])和垂直电机(position_tilt_range字段存在且不为[0.000000,0.000000])都有时才生效，即同时支持水平和垂直电机时此字段才生效。取值范围：<br>- 缺少该字段或取值为0：支持水平和垂直电机同时转动；<br>- 该字段存在且取值为1：不支持水平和垂直电机同时转动；<br>备注：支持同时转动的云台才支持斜向运动。</td></tr><tr><td style='text-align:left;' >52</td><td style='text-align:left;' >quick_tour_unsupported <br>string</td><td style='text-align:left;' >该字段表示/tour模块是否不支持一键巡航功能。该字段取值范围：<br>1) 当设备支持巡航，即ptz的capability里tour_supported为1时：<br>   - 缺少该字段或取值为0：支持一键巡航；<br>   - 该字段存在且取值为1：不支持一键巡航；<br>2) 当设备不支持巡航，即ptz的capability里tour_supported为0时：<br>   - 不支持一键巡航；</td></tr><tr><td style='text-align:left;' >53</td><td style='text-align:left;' >quick_park_unsupported <br>string</td><td style='text-align:left;' >该字段表示/ptz模块是否不支持一键守望功能。该字段取值范围：<br>1) 当设备支持守望，即ptz的capability里park_supported为1时：<br>   - 缺少该字段或取值为0：支持一键守望（/ptz/quick_park服务）；<br>   - 该字段存在且取值为1：不支持一键守望（/ptz/quick_park服务）；<br>2) 当设备支持不守望，即ptz的capability里park_supported为0时：<br>   - 不支持一键守望（/ptz/quick_park服务）；</td></tr><tr><td style='text-align:left;' >54</td><td style='text-align:left;' >preset_image_freeze_unsupported <br>string</td><td style='text-align:left;' >该字段表示/preset/config是否不支持预置点视频冻结功能。该字段取值范围：<br>- 缺少该字段或取值为0：支持预置点视频冻结；<br>- 该字段存在且取值为1：不支持预置点视频冻结；</td></tr><tr><td style='text-align:left;' >55</td><td style='text-align:left;' >app_zoom_multiple_range <br>array<string></td><td style='text-align:left;' >该字段表示客户端自身的缩放倍率范围。  <br> 1.若存在zoom_multiple_range和extend_zoom_method，且不存在app_zoom_multiple_range，则客户端的缩放倍率范围为zoom_multiple_range的最小值（含）到zoom_multiple_range的最大值<em>3（含）之间，其中zoom_multiple_range的最小值到zoom_multiple_range的最大值为设备端的缩放倍率范围，而控制端额外电子放大的倍率固定为3倍；   <br>2.若存在zoom_multiple_range和extend_zoom_method，且存在app_zoom_multiple_range，则客户端的缩放范围为zoom_multiple_range的最小值</em>app_zoom_multiple_range的最小值（含）到zoom_multiple_range的最大值*app_zoom_multiple_range的最大值（含）之间。</td></tr><tr><td style='text-align:left;' >56</td><td style='text-align:left;' >zoom_limit_supported <br>string</td><td style='text-align:left;' >是否支持变倍限制功能。<br>取值范围：<br>缺少该字段或取值为0：不支持变倍限制功能，设备允许的最大变倍倍数为zoom_multiple_range 字段的最大值；<br>该字段存在且取值为1：支持变倍限制功能。</td></tr><tr><td style='text-align:left;' >57</td><td style='text-align:left;' >zoom_limit_multiple_list <br>array<string></td><td style='text-align:left;' >设备支持变倍限制的变倍倍数。<br>当zoom_limit_supported 字段存在且取值为1时，此字段有意义。</td></tr><tr><td style='text-align:left;' >58</td><td style='text-align:left;' >angle_relative_move_supported <br>string</td><td style='text-align:left;' >是否支持通过角度控制相对移动。<br>取值范围：<br>缺少该字段或取值为0：不支持通过角度控制相对移动；<br>该字段存在且取值为1：支持通过角度控制相对移动。</td></tr><tr><td style='text-align:left;' >59</td><td style='text-align:left;' >dynamic_zoom_multiple_range <br>array<string></td><td style='text-align:left;' >设备动态支持的倍率范围，即设备在不同情况下支持不同的可调倍率范围。<br>取值范围：<br>不存在该字段或者取值为空时：设备不支持动态倍率范围。<br>此字段存在且不为空时：每一组表示设备支持的可调整倍率范围，最小值与最大值之间用“-”号分割。</td></tr><tr><td style='text-align:left;' >60</td><td style='text-align:left;' >dynamic_zoom_multiple_type <br>array<string></td><td style='text-align:left;' >设备动态支持的倍率范围对应的类型。<br>取值范围：<br>0：默认模式<br>1：夜视省电模式<br>后续有其他需求可以再新增。<br>该字段仅在dynamic_zoom_multiple_range字段存在且不为空时生效，与dynamic_zoom_multiple_range字段内的倍率范围一一对应，表明设备支持的倍率范围对应的类型。</td></tr><tr><td style='text-align:left;' >61</td><td style='text-align:left;' >ptz_lock_supported <br>string</td><td style='text-align:left;' >是否支持云台锁定功能。<br>取值范围：<br>缺少该字段或取值为0：不支持云台锁定功能；<br>该字段存在且取值为1：支持云台锁定功能和云台解锁。</td></tr></tbody></table></figure><h4><a name='header-n1379' class='md-header-anchor '></a>6.3.2 Motor</h4><figure><table><thead><tr><th style='text-align:center;' >序号</th><th style='text-align:center;' >能力集字段</th><th style='text-align:center;' >能力集字段说明</th></tr></thead><tbody><tr><td style='text-align:center;' >1</td><td style='text-align:center;' >x_coord_min<br>string</td><td style='text-align:center;' >水平电机逆时针方向的最大可转动位置（极限坐标），单位为度(整数)。取值范围：-180-0</td></tr><tr><td style='text-align:center;' >2</td><td style='text-align:center;' >x_coord_max <br>string</td><td style='text-align:center;' >水平电机顺时针方向的最大可转动位置（极限坐标），单位为度(整数)。取值范围：0-180</td></tr><tr><td style='text-align:center;' >3</td><td style='text-align:center;' >y_coord_min <br>string</td><td style='text-align:center;' >垂直电机逆时针方向的最大可转动位置（极限坐标），单位为度(整数)。取值范围：-90-0</td></tr><tr><td style='text-align:center;' >4</td><td style='text-align:center;' >y_coord_max<br>string</td><td style='text-align:center;' >垂直电机顺时针方向的最大可转动位置（极限坐标），单位为度(整数)。取值范围：0-90</td></tr><tr><td style='text-align:center;' >5</td><td style='text-align:center;' >x_max_speed<br>string</td><td style='text-align:center;' >电机转动最大速度，具体含义由每个电机自行定义。用于客户端根据此值定义自己的速度“档次”(整数)。</td></tr><tr><td style='text-align:center;' >6</td><td style='text-align:center;' >y_max_speed <br>string</td><td style='text-align:center;' >电机转动最大速度，具体含义由每个电机自行定义。用于客户端根据此值定义自己的速度“档次”(整数)。</td></tr><tr><td style='text-align:center;' >7</td><td style='text-align:center;' >simultaneous <br>string</td><td style='text-align:center;' >表示水平电机与竖直电机能否同时转动。<br>1：可以<br>0：不可以</td></tr><tr><td style='text-align:center;' >8</td><td style='text-align:center;' >preset<br>string</td><td style='text-align:center;' >表示该设备是否支持预置点功能。<br>1：支持<br>没有该项或0：不支持</td></tr><tr><td style='text-align:center;' >9</td><td style='text-align:center;' >calibrate <br>string</td><td style='text-align:center;' >表示该设备是否支持手动校准功能。<br>1：支持<br>没有该项或0：不支持</td></tr><tr><td style='text-align:center;' >10</td><td style='text-align:center;' >scan_tour<br>string</td><td style='text-align:center;' >表示该设备是否支持扫描巡航功能。<br>1：支持<br>没有该项或0：不支持</td></tr><tr><td style='text-align:center;' >11</td><td style='text-align:center;' >multipoint_tour<br>string</td><td style='text-align:center;' >表示该设备是否支持多点巡航功能。<br>1：可以<br>没有该项或0：不可以</td></tr><tr><td style='text-align:center;' >12</td><td style='text-align:center;' >panorama <br>string</td><td style='text-align:center;' >表示该设备是否支持生成全景图功能。<br>1：支持<br>没有该项或0：不支持</td></tr><tr><td style='text-align:center;' >13</td><td style='text-align:center;' >picture_number <br>string</td><td style='text-align:center;' >表示用于生成全景图总的图片数量。需与panorama配合使用，如果panorama不支持则无该字段。</td></tr><tr><td style='text-align:center;' >14</td><td style='text-align:center;' >overlap_width_percent <br>string</td><td style='text-align:center;' >表示生成全景图时图片重合宽度比例。需与panorama配合使用，如果panorama不支持则无该字段。浮点型字符串，取值范围0-100.0。</td></tr><tr><td style='text-align:center;' >15</td><td style='text-align:center;' >panorama_x_coord_start <br>string</td><td style='text-align:center;' >表示生成全景图结束时的水平电机位置，单位为度(整数)。需与panorama配合使用，如果panorama不支持则无该字段。</td></tr><tr><td style='text-align:center;' >16</td><td style='text-align:center;' >panorama_x_coord_end <br>string</td><td style='text-align:center;' >表示生成全景图结束时的水平电机位置，单位为度(整数)。需与panorama配合使用，如果panorama不支持则无该字段。</td></tr><tr><td style='text-align:center;' >17</td><td style='text-align:center;' >distortion_correction_k1 <br>string</td><td style='text-align:center;' >表示生成全景图结束时的镜头畸变矫正参数k2。需与panorama配合使用，如果panorama不支持则无该字段。浮点型字符串。</td></tr></tbody></table></figure></div>
</body>
</html>